A question about node memory management.  I have (see below) a very simple 
bit of code that, when run, slowly increases it's RSS usage forever.

I've tried setting variable to null and deleting variables - no effect.
Adding or removing the nextTick has no effect.

It just sits there, running and slowly eating RSS.  heapUsed goes up and 
down as garbage collection occurs.

Am I missing the point somewhere?  why would  asimple program like this 
start with an RSS of 8-9 MB and over the course of 5 minutes have the RSS 
grow to 12.5MB and continue to grow from there?

var memInfo = {
    rss: 0,
    heapTotal: 0,
    heapUsed: 0
}

var timer = setInterval(function () {
    process.nextTick(function () {
        var mem = process.memoryUsage();
        if (mem.rss > memInfo.rss) {
            memInfo.rss = mem.rss;
        }
        if (mem.heapTotal > memInfo.heapTotal) {
            memInfo.heapTotal = mem.heapTotal;
        }
        if (mem.heapUsed > memInfo.heapUsed) {
            memInfo.heapUsed = mem.heapUsed;
        }

        console.log('Latest', process.memoryUsage());
        console.log('Max   ', memInfo);
    });
}, 1000);



-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/86e575d8-2426-4dd4-a376-1a2054be7340%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to