Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limiting node.js's memory usage

I am trying to limit a node.js application from using to much memory and I've found out about the --max-stack-size & --max_executable_size options that are available within V8 to pass when invoking the file, but how should I combine these and possible other arguments to limit max memory usage to 1GB?

like image 731
Industrial Avatar asked Oct 08 '12 10:10

Industrial


Video Answer


1 Answers

https://github.com/joyent/node/wiki/FAQ

What is the memory limit on a node process?

Currently, by default v8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max_old_space_size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit), but it is recommended that you split your single process into several workers if you are hitting memory limits.

Value is in megabytes, I believe.

like image 82
Josh Avatar answered Oct 12 '22 02:10

Josh