summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-13 12:07:19 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-13 12:07:37 +0100
commit9753782f96bcd9b35a4c45d6cb20de2a85c33e55 (patch)
treee77444d61573d6f99b128d4116dba3f580902594 /compiler
parente142f4c371adebb2eee426ac207f811ed0f0bd99 (diff)
downloadNim-9753782f96bcd9b35a4c45d6cb20de2a85c33e55.tar.gz
memory allocator hotfix: do not allocate tremendous amounts of memory
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/main.nim b/compiler/main.nim
index e6563f281..888f89ad5 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -271,9 +271,13 @@ proc mainCommand*(graph: ModuleGraph; cache: IdentCache) =
 
   if msgs.gErrorCounter == 0 and
      gCmd notin {cmdInterpret, cmdRun, cmdDump}:
+    when declared(system.getMaxMem):
+      let usedMem = formatSize(getMaxMem()) & " peekmem"
+    else:
+      let usedMem = formatSize(getTotalMem())
     rawMessage(hintSuccessX, [$gLinesCompiled,
                formatFloat(epochTime() - gLastCmdTime, ffDecimal, 3),
-               formatSize(getTotalMem()),
+               usedMem,
                if condSyms.isDefined("release"): "Release Build"
                else: "Debug Build"])