profile not showing it all?
ketil+haskell at ii.uib.no
Fri Sep 9 03:51:47 EDT 2005
Malcolm Wallace <Malcolm.Wallace at cs.york.ac.uk> writes:
>> After running it with +RTS -hc, it shows a graph that reaches a
>> peak at around 85mb. However, when i check the memory usage with
>> 'top' i see the application reach over 300mb.
I may be wrong, but I think profiling only tells you the size of live
data for your program. The program itself, libraries, etc will not be
The program is also likely to allocate more memory from the OS than it
is using, either because it is keeping dead data around between
collections or because OS allocation has a certain granularity. (To
check the former, you can perhaps try limiting the heap size.)
I'm not sure allocated memory is ever returned to the OS - I tried
strace'ing for brk(2) without getting much wiser.
My experience is that top will report quite a bit more than profiling.
300Mb seems like a bit much for 85Mb heap, though.
If I haven't seen further, it is by standing in the footprints of giants
More information about the Glasgow-haskell-users