Revert "Add some (belated) memory watching"

This reverts commit 217091010a.
This commit is contained in:
Matt Godbolt 2015-04-05 23:34:44 -05:00
parent 217091010a
commit d015e8f790
3 changed files with 27 additions and 28 deletions

52
app.js
View File

@ -36,12 +36,12 @@ var nopt = require('nopt'),
Promise = require('promise'),
memwatch = require('memwatch');
memwatch.on('leak', function (info) {
console.log("Memwatch leak: " + JSON.stringify(info));
memwatch.on('leak', function(info){
console.log("Memwatch leak: " + info);
});
memwatch.on('stats', function (stats) {
console.log("Memwatch stats: " + JSON.stringify(stats));
memwatch.on('stats', function(stats){
console.log("Memwatch stats: " + info);
});
var opts = nopt({
@ -195,29 +195,29 @@ function configuredCompilers() {
var port = parseInt(bits[1]);
console.log("Fetching compilers from remote source " + host + ":" + port);
return retryPromise(function () {
return new Promise(function (resolve, reject) {
http.get({
hostname: host,
port: port,
path: "/api/compilers"
}, function (res) {
var str = '';
res.on('data', function (chunk) {
str += chunk;
});
res.on('end', function () {
var compilers = JSON.parse(str).map(function (compiler) {
compiler.exe = null;
compiler.remote = "http://" + host + ":" + port;
return compiler;
});
resolve(compilers);
});
}).on('error', function (e) {
reject(e);
return new Promise(function (resolve, reject) {
http.get({
hostname: host,
port: port,
path: "/api/compilers"
}, function (res) {
var str = '';
res.on('data', function (chunk) {
str += chunk;
});
res.on('end', function () {
var compilers = JSON.parse(str).map(function (compiler) {
compiler.exe = null;
compiler.remote = "http://" + host + ":" + port;
return compiler;
});
resolve(compilers);
});
}).on('error', function (e) {
reject(e);
});
},
});
},
host + ":" + port,
props.get('gcc-explorer', 'proxyRetries', 20),
props.get('gcc-explorer', 'proxyRetryMs', 500));
@ -263,7 +263,7 @@ function getCompilerInfo(compilerInfo) {
});
}
if (options['-masm']) {
compilerInfo.intelAsm = "-masm=intel";
compilerInfo.intelAsm="-masm=intel";
}
resolve(compilerInfo);
});

View File

@ -46,7 +46,7 @@ function Compile(compilers) {
this.cache = LRU({
max: props.get('gcc-explorer', 'cacheMb') * 1024 * 1024,
length: function (n) {
return n.asm.length;
return n.length;
}
});
this.cacheHits = 0;

View File

@ -23,7 +23,6 @@
"fs-extra": "0.8.x",
"http-proxy": "1.8.x",
"lru-cache": "2.5.x",
"memwatch": "0.2.x",
"morgan": "1.5.x",
"promise": "6.1.x",
"promise-queue": "2.1.x",