On Mon, Nov 19, 2012 at 4:41 PM, Ben Noordhuis <[email protected]>
wrote:
> A quick and fairly reliable approach is to start node with --expose-gc
> and call gc() every few seconds, like so:
>
> [...]
With [memwatch][1] something similar can be done:
$ cat test.js
'use strict';
var memwatch = require('memwatch');
memwatch.on('stats', function (stats) {
console.log('current base:', stats.current_base);
});
setInterval(memwatch.gc, 5000);
$ node --expose-gc test.js
current base: 1217308
current base: 1217512
current base: 1371772
current base: 1373436
Again I do see fluctuations; haven't investigated that yet.
[1]: https://github.com/lloyd/node-memwatch
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en