memInventory: optionally dump the memory inventory
[ghc-hetmet.git] / rts / sm / GC.c
index fe26cf9..0d2ba85 100644 (file)
@@ -214,11 +214,6 @@ GarbageCollect ( rtsBool force_major_gc )
   stmPreGCHook();
 
 #ifdef DEBUG
-  // check for memory leaks if DEBUG is on 
-  memInventory();
-#endif
-
-#ifdef DEBUG
   mutlist_MUTVARS = 0;
   mutlist_MUTARRS = 0;
   mutlist_OTHERS = 0;
@@ -266,6 +261,11 @@ GarbageCollect ( rtsBool force_major_gc )
   }
 #endif
 
+#ifdef DEBUG
+  // check for memory leaks if DEBUG is on 
+  memInventory(traceClass(DEBUG_gc));
+#endif
+
   // check stack sanity *before* GC (ToDo: check all threads) 
   IF_DEBUG(sanity, checkFreeListSanity());
 
@@ -667,7 +667,7 @@ GarbageCollect ( rtsBool force_major_gc )
 
 #ifdef DEBUG
   // check for memory leaks if DEBUG is on 
-  memInventory();
+  memInventory(traceClass(DEBUG_gc));
 #endif
 
 #ifdef RTS_GTK_FRONTPANEL