
Ketil Malde wrote:
I'm using heap profiling on AMD64, and I am getting some slightly strange results. Running the profiling, 'top' shows about 600Mb in use, but the resulting profile shows ~80Mb. Rerunning with -M200M results in an out-of-memory error.
Could it be that the profile is calculated incorrectly for 64bit systems?
It's probably correct. Profiling overheads add 50-100% to the space usage, which is subtracted from the profile. Copying GC will use about 3x the live data in normal operation: 2x due to the copying, and an extra 1x to allocate into, plus there may be some free memory due to fragmentation (hopefully not much). The +RTS -sstderr will give you an accurate figure of how much memory GHC's allocator is using. Cheers, Simon