On Mon, Mar 1, 2010 at 01:16, Warren Harris wrote: > I would like to determine what percentage of my application's cpu time is > spent in the garbage collector (for tuning purposes, but also just to > monitor the overhead). Is there any way to obtain this information short of > using gprof? Additional information provided by Gc.stat would be ideal, or > perhaps a Gc.alarm that was called at the beginning of the gc cycle, but > neither of these seem to exist. Here's what I use to measure GC overhead in my programs. There's a small modification to the runtime, so as to track the time spent in caml_minor_collection, and a helper ml module. It tracks and prints the time spent between calls to the start() and stop() function of the helper module, as well the number of collections, number of bytes allocated, etc. It is rather coarse-grained of course. I use it to profile the different parts of a compiler: parsing, typing, optimizations, code generation, etc. -- Olivier