Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Slow GC problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] Slow GC problem

>I am concluding that gc is to blame.

Did you profile to check this assumption?  What's the profile look like?

>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.)

The malloc heap should be mostly separate from the caml heap (assuming the 
malloc heap is allocated in big chunks).  If you're really worried about 
this, write your own bigarray allocator (it's easy) and allocate them 
yourself out of an already allocated big block of memory.

Are you sure you're not paging?  100k 30x30 arrays is 360MB (or 720MB if 
you're using doubles).  Also, if you're constantly allocating and freeing 
bigarrays you might be more dependent on malloc speed than caml GC speed.

Best to post the profile.  Use the -p command to ocamlopt, or -ccopt and 
-cclib commands to use another profiler.  You can see examples of gc-bound 
profiles in the list archive.

Chris

-------------------
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