问题
We are deploying a Node.js application. This app seems to be consuming way more RSS memory than it should. So we started to dive into things and we found the following, thanks to process.memoryUsage();
The RSS memory grows quickly to about 400MB and stays more or less stable in a 400MB-500MB, with small ups and small downs (Garbage collector running?)
The heapUsed quickly grows to 50MB and then stays at that level (between 20MB and 100MB).
The heaptotal is always about 30MB more MB than the heapUsed.
As you see there is a huge difference between the heap and the RSS, which is where I think we should focus. There doesn't seem to be any very significant leak in our heap.
Now, what's in RSS that is not in the heap? I believe C extensions, and Buffers, right? If so, how can we debug that. What else should we look for?
回答1:
Without knowing what your app is doing, it is impossible to comment on this.
If the V8 heap usage is significantly lower than the RSS, then yes, it must be external buffers and other memory used by non-V8 objects.
Can you make some code public?
来源:https://stackoverflow.com/questions/13126808/whats-the-node-js-memory-breakdown