简体   繁体   中英

Why node.js process taking more memory than allocated

Can someone please explain why my Node.js process is taking more than allocated memory?

I assigned 4G of memory to Nodejs process (maximum supported on 64bit machine, as per Nodejs doc), but I have seen process touching 5.6g of RSS memory (way higher than 4g that I assigned)

This is how I am running the process

node -max-old-space-size=4096 processName.js

This is what my TOP command shows (RSS @4.6g) 在此输入图像描述

max-old-space-size controls one aspect of node.js memory usage within the interpreter as used for the storage of Javascript objects (sometimes referred to as the V8 heap), not the entire memory usage of the whole process. For example, max-old-space-size has nothing to do with how much memory the native code portions of node.js use at all.

So, total memory usage can always be more than max-old-space-size .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM