From cab75f7c7a52ecea0309ff8c2f677eb313360629 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Tue, 8 Dec 2015 08:32:43 -0600 Subject: [PATCH] Kill memwatch --- app.js | 35 ----------------------------------- package.json | 1 - 2 files changed, 36 deletions(-) diff --git a/app.js b/app.js index dfd41054..1c62a88f 100755 --- a/app.js +++ b/app.js @@ -63,40 +63,6 @@ function compilerProps(property, defaultValue) { require('./lib/compile').initialise(gccProps, compilerProps); var staticMaxAgeMs = gccProps('staticMaxAgeMs', 0); -function initializeMemwatch() { - var memwatch = require('memwatch-next'); - console.log("Initial GC"); - memwatch.gc(); - // Everything else happens a little later to let the initial GC finish. - setTimeout(function () { - var lastDiff = new memwatch.HeapDiff(); - memwatch.on('leak', function (info) { - console.log("Memwatch leak: " + JSON.stringify(info)); - }); - - memwatch.on('stats', function (stats) { - console.log("Memwatch stats: " + JSON.stringify(stats)); - }); - - var heapDiffEverySecs = gccProps('gcHeapDiffEverySecs', 0); - if (heapDiffEverySecs) { - console.log("Diffing heap every " + heapDiffEverySecs + "s"); - setInterval(function () { - var diff = lastDiff.end(); - lastDiff = new memwatch.HeapDiff(); - console.log("Memwatch diff from last stats: " + JSON.stringify(diff)); - }, 1000 * heapDiffEverySecs); - } - var gcIntervalSecs = gccProps("gcIntervalSecs", 0); - if (gcIntervalSecs) { - console.log("Forcing a GC every " + gcIntervalSecs + "s"); - setInterval(function () { - memwatch.gc(); - }, 1000 * gcIntervalSecs); - } - }, 1 * 1000); -} - function loadSources() { var sourcesDir = "lib/sources"; var sources = fs.readdirSync(sourcesDir) @@ -376,7 +342,6 @@ findCompilers().then(function (compilers) { console.log("======================================="); console.log("Listening on http://" + os.hostname() + ":" + port + "/"); console.log("======================================="); - initializeMemwatch(); webServer.listen(port); }).catch(function (err) { console.log("Error: " + err.stack); diff --git a/package.json b/package.json index 9a8465c6..db48f1ee 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "fs-extra": "0.26.x", "http-proxy": "1.12.x", "lru-cache": "2.7.x", - "memwatch-next": "0.2.x", "morgan": "1.6.x", "promise": "7.0.x", "promise-queue": "2.1.x",