summaryrefslogtreecommitdiff
path: root/rts/Stats.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-14 14:59:45 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-14 14:59:45 +0000
commita6049f031d1693ac8a365d9b2adb02a6f835de47 (patch)
treec22bb95ed098a3134296ca6908236d39382e8947 /rts/Stats.c
parentac834f4821d2189a335d289a8d36e5fa70f1512d (diff)
downloadhaskell-a6049f031d1693ac8a365d9b2adb02a6f835de47.tar.gz
Fix the "lost due to fragmentation" calculation
It was counting the space used by block descriptors as "lost"
Diffstat (limited to 'rts/Stats.c')
-rw-r--r--rts/Stats.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/Stats.c b/rts/Stats.c
index d7d45a413b..e519c940af 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -590,7 +590,7 @@ stat_exit(int alloc)
statsPrintf("%16ld MB total memory in use (%ld MB lost due to fragmentation)\n\n",
peak_mblocks_allocated * MBLOCK_SIZE_W / (1024 * 1024 / sizeof(W_)),
- (peak_mblocks_allocated * MBLOCK_SIZE_W - hw_alloc_blocks * BLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)));
+ (peak_mblocks_allocated * BLOCKS_PER_MBLOCK * BLOCK_SIZE_W - hw_alloc_blocks * BLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)));
/* Print garbage collections in each gen */
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {