I noticed that the RSS (Resident Set Size) of my node.js application is growing over time, and considering that I have a "JS Object Allocation Failed - Out of Memory" error on my server, this seems like the likely cause.
I installed the following very simple Node application:
var express = require('express'); var app = express(); app.get('/',function(req,res,next){ res.end(JSON.stringify(process.memoryUsage())); }); app.listen(8888);
Just by holding the "Update" hotkey @http: // localhost: 8888 / I can watch RSS / heap / etc. grow until RSS gets above 50 mb (before I get bored). Waiting a few minutes and returning, RSS crashes - presumably, the GC is working.
I am trying to find out if this explains why my actual Node application crashes ... my production application quickly hits 100 MB RSS when it crashes, it usually amounts to 200 MB-300 MB. As far as I can tell, this should not be too large (node should be able to handle 1.7Gb or so, I suppose), but nonetheless I am concerned that the RSS size on my production server is growing up (downturns are glitches) :

Zane claes
source share