Browse thread
[Caml-list] Slow GC problem
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Shivkumar Chandrasekaran <shiv@e...> |
| Subject: | Re: [Caml-list] Slow GC problem |
This seems to be confirmed by some modifications I did to the code. I was able to reduce a whole lot of temporary bigarray allocations and got a 30% speed improvement. However any further reduction of bigarray creation will require a major "add-on" modification to my entire library design, or, memory re-use hacks all over the place. So I would like to be reasonably sure that this is worth-while before I proceed. On Tuesday, April 8, 2003, at 03:28 AM, Damien Doligez wrote: > On Monday, April 7, 2003, at 07:53 PM, Shivkumar Chandrasekaran wrote: > >> 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, > > It doesn't matter. The ocaml heap is allocated in big chunks from > malloc, > and other malloc blocks cannot interfere with its fragmentation. > > If your program is allocating lots of temporary bigarrays and leaves > them > to be collected by the GC, then I would say it's using bigarrays in an > inefficient way. Bigarrays are mostly designed to be long-lived > objects. > If you can find a way to re-use your bigarrays instead of allocating > new > ones, you should get better performance. > > -- Damien > > ------------------- > 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