Skip to content

Instantly share code, notes, and snippets.

@crash2burn
Created March 31, 2015 16:30
Show Gist options
  • Save crash2burn/e545a8f5c78729d090a9 to your computer and use it in GitHub Desktop.
Save crash2burn/e545a8f5c78729d090a9 to your computer and use it in GitHub Desktop.
var http = require('http')
function Wat() {
this.get = function(cb) {
var options = {
host: "localhost",
port: "3030",
path: "",
headers: {'Content-Type': 'application/json'},
method: 'GET',
followAllRedirects: true
};
function callback(response) {
cb('a')
options = null;
callback = null;
req = null
}
var req = http.request(options, callback);
req.on('error', function() {
});
req.end();
}
}
w = new Wat();
setInterval(function() {
w.get(function Werd(res) {
res = null
})
}, 500)
setInterval(function () {
console.log(process.memoryUsage().rss)
}, 2000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment