about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-18T15·24+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-18T15·24+0100
commitfa472794400745d896607f7ea33cd2a0adff4c71 (patch)
tree413850572a8ecce5ecadc4df25b038263714b40d /src/libexpr/eval.cc
parent7a84143910cdb8445d0b0256b902bf3a6cfdcb8d (diff)
Print some Boehm GC stats
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 4ee0b793b240..01f0be52da0e 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1515,6 +1515,13 @@ void EvalState::printStats()
     printMsg(v, format("  number of function calls: %1%") % nrFunctionCalls);
     printMsg(v, format("  total allocations: %1% bytes") % (bEnvs + bLists + bValues + bAttrsets));
 
+#if HAVE_BOEHMGC
+    GC_word heapSize, totalBytes;
+    GC_get_heap_usage_safe(&heapSize, 0, 0, 0, &totalBytes);
+    printMsg(v, format("  current Boehm heap size: %1% bytes") % heapSize);
+    printMsg(v, format("  total Boehm heap allocations: %1% bytes") % totalBytes);
+#endif
+
     if (countCalls) {
         v = lvlInfo;