On Sun, Jan 08, 2012 at 05:50:40PM -0500, [email protected] wrote: > Isn't the goal of compaction to keep all of these blocks of memory > as close as possible? I should have noted the fragmentation of my > heap after compaction, but it seems unlikely that my < 1meg of actual > data could be fragmented across 400megs worth of chunks.
I might not have been clear: memory can only be given back to the OS at the C / malloc allocator level. OCaml compaction has nothing to do with this because C allocations (and data structures used by malloc itself) cannot ever be moved. However you can get a clearer picture if you look at /proc/<pid>/maps or smaps and also if you have a debugging malloc implementation. > > Here's the news: the OS doesn't need you to give back > > memory. Because of virtual memory and swap, the OS will quite happily > > take back your memory whenever it wants without asking you. > > For most cases this is true, however in my case (which is not the > usual case), my OS has no swap. We actually prefer things to fail > than to be swapped because we are doing computations could take months > if we get into a swapping situation. I'm no linux expert so our > solution is to not have swap and to keep our VMs light when it comes > to I/O. Perhaps this is a poor solution but it does change things for > us. Sure, this is a perfectly valid case, we have many customers who use RHEL like this. Rich. -- Richard Jones Red Hat -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
