From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA15592; Mon, 7 Apr 2003 19:53:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA15582 for ; Mon, 7 Apr 2003 19:53:35 +0200 (MET DST) Received: from xanadu.ece.ucsb.edu (xanadu.ece.ucsb.edu [128.111.56.51]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h37HrXX20486 for ; Mon, 7 Apr 2003 19:53:34 +0200 (MET DST) Received: from ece.ucsb.edu (gimli.ece.ucsb.edu [128.111.56.252]) by xanadu.ece.ucsb.edu (8.11.6+Sun/8.11.6) with ESMTP id h37HrUS18970 for ; Mon, 7 Apr 2003 10:53:30 -0700 (PDT) Date: Mon, 7 Apr 2003 10:53:00 -0700 Subject: Re: [Caml-list] Slow GC problem Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) From: Shivkumar Chandrasekaran To: caml-list@inria.fr Content-Transfer-Encoding: 7bit In-Reply-To: <3C821F52-66D5-11D7-A265-000393942C76@ece.ucsb.edu> Message-Id: X-Mailer: Apple Mail (2.551) X-Spam: no; 0.00; shivkumar:01 shiv:01 caml-list:01 enquiry:99 malloc:01 allocates:01 bigarrays:01 --shiv--:01 solver:01 slower:01 chunks:01 847:99 bug:01 faq:01 beginner's:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Pursuing my earlier enquiry: I noticed that module Bigarray allocated its arrays using "malloc" rather than on the ocaml heap. My problem allocates a lot (say 100,000) bigarrays of rather small size (say 30 x 30). Can this potentially increase the cost of gc? (I have this mental picture of the ocaml heap fragmented by these immovable malloc'd bigarrays.) Any help will be appreciated. Thanks, --shiv-- On Friday, April 4, 2003, at 11:40 AM, Shivkumar Chandrasekaran wrote: > I have a gc efficiency problem for which I require some advice. I have > read both the O'Reilly book and the manual on gc. > > I am implementing a fast direct matrix solver for 2D PDEs. So it uses > the Bigarray module a lot. I have two versions of my algorithm. On is > an in-core algorithm and the other is the same solver, except that it > is out-of-core (most of the matrices are stored in disk files). > Unfortunately the out-of-core solver is *faster* than the in-core > solver for the identical problem! I was expecting the out-of-core > solver to be 10 times slower. I am concluding that gc is to blame. > Below I give the gc stats just before and after the solver routine is > called in the in-core solver: > > "Just before" "Just after" > minor_words: 46243376 139259767 > promoted_words: 928267 2595523 > major_words: 2883087 39489766 > minor_collections: 1412 4591 > major_collections: 18 52 > heap_words: 2150400 1044480 > heap_chunks: 35 17 > top_heap_words: 2150400 5038080 > live_words: 1842373 840037 > live_blocks: 253926 116816 > free_words: 307180 204440 > free_blocks: 47368 17 > largest_free: 10928 61440 > fragments: 847 3 > compactions: 0 2 > > I tried changing some parameters using Gc.set but it did not make a > significant difference. Does anybody see any obvious gc problems from > the above data? Thanks, > > --shiv-- > > > PS: I wrote the out-of-core solver in just 3 days once the in-core > solver was done, all in O'Caml. This would have have taken much longer > in Fortran/C. Thanks to the O'Caml team. > > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: > http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: > http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > --shiv-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners