[[project @ 2005-09-21 09:58:53 by simonmar] simonmar**20050921095853 distill a bit of wisdom from the mailing list ] { hunk ./ghc/docs/users_guide/profiling.xml 901 + + Actual memory residency hunk ./ghc/docs/users_guide/profiling.xml 904 + How does the heap residency reported by the heap profiler relate to + the actual memory residency of your program when you run it? You might + see a large discrepancy between the residency reported by the heap + profiler, and the residency reported by tools on your system + (eg. ps or top on Unix, or the + Task Manager on Windows). There are several reasons for this: hunk ./ghc/docs/users_guide/profiling.xml 911 + + + There is an overhead of profiling itself, which is subtracted + from the residency figures by the profiler. This overhead goes + away when compiling without profiling support, of course. The + space overhead is currently 2 extra + words per heap object, which probably results in + about a 30% overhead. + hunk ./ghc/docs/users_guide/profiling.xml 921 + + Garbage collection requires more memory than the actual + residency. The factor depends on the kind of garbage collection + algorithm in use: a major GC in the standard + generation copying collector will usually require 3L bytes of + memory, where L is the amount of live data. This is because by + default (see the option) we allow the old + generation to grow to twice its size (2L) before collecting it, and + we require additionally L bytes to copy the live data into. When + using compacting collection (see the + option), this is reduced to 2L, and can further be reduced by + tweaking the option. Also add the size of the + allocation area (currently a fixed 512Kb). + + + + The stack isn't counted in the heap profile by default. See the + option. + + + + The program text itself, the C stack, any non-heap data (eg. data + allocated by foreign libraries, and data allocated by the RTS), and + mmap()'d memory are not counted in the heap profile. + + + }