profile not showing it all?

Malcolm Wallace Malcolm.Wallace at
Thu Sep 8 18:21:51 EDT 2005

Niels <cpjvelde at> writes:

> since my application takes up way to much memory, i decided to profile it
> (compile d it with -prof and -auto-all). 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.

Are you checking 'top' on the profiled version?  It will show more heap
usage than the profile itself, because some heap space is taken up by
the profiling data itself.  But of course the profile is only supposed
to report the heap space that is used in normal usage, excluding the
overhead used to build the report.  The profiling overhead can certainly
double space usage, and with cost-centre stacks, it could be even
higher.  Don't forget to subtract the static size of the executable too.

If, however, you are comparing /unprofiled/ 'top' with the profile, it
suggests a fault in ghc's profiling code.


More information about the Glasgow-haskell-users mailing list