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 XAA03461; Thu, 10 Apr 2003 23:47:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA02777 for ; Thu, 10 Apr 2003 23:47:26 +0200 (MET DST) Received: from epexch01.qlogic.org ([63.170.40.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3ALlP924570 for ; Thu, 10 Apr 2003 23:47:25 +0200 (MET DST) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Thu, 10 Apr 2003 16:47:31 -0500 Received: from [10.20.33.146] ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Thu, 10 Apr 2003 16:47:30 -0500 Date: Thu, 10 Apr 2003 16:51:28 -0500 (CDT) From: Brian Hurt X-X-Sender: Reply-To: Brian Hurt To: Shivkumar Chandrasekaran cc: Subject: Re: [Caml-list] Slow GC problem In-Reply-To: <6FA5A4AF-6B9A-11D7-B23F-000393942C76@ece.ucsb.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 10 Apr 2003 21:47:30.0964 (UTC) FILETIME=[C97B9D40:01C2FFAA] X-Spam: no; 0.00; qlogic:01 caml-list:01 alloc:01 gcc:01 shivkumar:01 re-use:01 bigarrays:01 allocating:01 malloc:01 gc'd:01 soundness:01 --shiv--:01 damien:01 solver:01 chunks:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk In playing around with the C interface code myself, I noticed that alloc_custom (the function that IMHO bigarray should be using to allocate it's blocks) has two arguments you pass in, which control how often the blocks get garbage collected- used and max. The gcc does a full gc every used/max blocks allocated (more or less). Perhaps the bigarray library should be extended to allow the user to set these variables. I'm wondering if different values here might not solve Shivkumar's problem in a more elegant (read: nice) way? Brian On Thu, 10 Apr 2003, Shivkumar Chandrasekaran wrote: > > I took Damien's advice (thanks) and spent some time trying to re-use > all the bigarrays I was allocating. However, my bigarray use is spread > out over a fairly complicated algorithm, and the only way to make a > good dent on bigarray use would be to completely rewrite the algorithm > in a more traditional fortran77 style. Which would of course mean that > I would have to first figure out the entire memory usage pattern. > > ...... So I am pondering another solution: > > What if I modified bigarray_stubs.c to use the malloc and free calls of > the Boehm gc (6.1-4) garbage collector? My reasoning is that malloc is > performing poorly due to fragmentation, and switching to a gc'd version > might help out. > > Before I try this I would like some feedback from the list on the > soundness of this idea. Thanks, > > --shiv-- > > On Tuesday, April 8, 2003, at 03:23 AM, Damien Doligez 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. > > [...] > >> 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 > > > > As others have said, this is not really enough information to tell > > what is going on. What we can say from the above is: > > > > 1. You are allocating lots and lots of data structures in the major > > heap (maybe finalized bigarray descriptors) > > 2. The compactor was called twice, which may indicate that you have > > a fragmentation problem. > > 3. The compactor was called near the end of the solver routine, > > which must have erased most of the evidence... > > > > -- Damien > > > --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 > ------------------- 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