From a6049f031d1693ac8a365d9b2adb02a6f835de47 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 14 Sep 2010 14:59:45 +0000 Subject: [PATCH] Fix the "lost due to fragmentation" calculation It was counting the space used by block descriptors as "lost" --- rts/Stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Stats.c b/rts/Stats.c index d7d45a4..e519c94 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++) { -- 1.7.10.4