Node.js Memory allocation

Not applicable

I have Xms1024m -Xmx3072m on my MP where as when I print mem usage in my node.js script I see

mem{ rss: 1045430272, heapTotal: 2863661056, heapUsed: 1045430272 }.

I assume this ~2864 mb is separate but not part of MP memory allocation , true ? If thats true if I have any memory leaks in my node.js will it bring Mp down ?

Solved Solved
0 5 731
1 ACCEPTED SOLUTION

Not applicable
The Node code runs in the same heap as everything in the MP -- it's all one big heap. "process.memoryUsage()" was returning strange results a few releases ago -- you might be better off using ordinary Java mechanisms to track your memory usage.

View solution in original post

5 REPLIES 5

A memory leak in node.js code will bring down the MP. It isn't easy to but not impossible to create leaks. The node.js heap memory is a subset of the total available memory.

so is ~2864 allocated to node.js and only 100 being used by MP on startup ? I don't understand how memory is allocated . any ideas ?

where did you get the 100? heap used is 1045 mb.

Not applicable
The Node code runs in the same heap as everything in the MP -- it's all one big heap. "process.memoryUsage()" was returning strange results a few releases ago -- you might be better off using ordinary Java mechanisms to track your memory usage.

@Greg Brail Is it possible to increase this heap size for the nodejs process? Or would it work if we just increase the JVM memory?