I am running a fork of mfp's ocamlmq. I am trying to track down an apparent memory leak, after a week of heavy usage the process is using up 2GB of RAM, and after looking in all the obvious places (all of the containers tracked in the state object in the mq appear to be empty or steady in their size, including queues, data is moving in and out of them but not accumulating, memory consumption should be nearly O(1)) I decided to see what the gc could tell me. I've been printing out gc stats and am wondering if someone can help me grok how the runtime works. In this case I'm trying to compare top to what the gc says. The exact values are below, but the essence of it is that top states the process is using 238m of RAM whereas the gc states that the heap size is about 66megs. My understanding is that the heap size is the total amount of memory that the runtime has under its supervision.
I am running Ubuntu Linux on a 64bit virtual machine running in VMWare on an Ubuntu Linux OS. My questions are: - Is top untrustworthy here? Or is the heap_words value not the full story? - Are there any tools that make it easier for me to track down memory leaks? Thank you Top: VIRT = 250m RES = 238m GC: Heap size according to gc output = 66536k minor_words: 6843117723 promoted_words: 271790582 major_words: 1752005911 minor_collections: 210261 major_collections: 2358 heap_words: 8516608 heap_chunks: 16 top_heap_words: 30736896 live_words: 6936631 live_blocks: 1083582 free_words: 1579967 free_blocks: 1457 largest_free: 399643 fragments: 10 compactions: 465 -- 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