Skip to content

Instantly share code, notes, and snippets.

@paulbatum
Created October 1, 2014 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulbatum/be5ce06e913a5d68f255 to your computer and use it in GitHub Desktop.
Save paulbatum/be5ce06e913a5d68f255 to your computer and use it in GitHub Desktop.
Memory allocation test
var memorySink = [];
exports.post = function(request, response) {
var sizeKB = request.query.kb || 1024;
var entry = { size: sizeKB, buffer: new Buffer(sizeKB * 1024) };
memorySink.push(entry);
response.send(statusCodes.OK);
};
exports.get = function(request, response) {
var entries = memorySink.map(function(x) { return { size: x.size }; });
response.send(statusCodes.OK, entries);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment