Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT working V8 node option (--max_old_space_size) to increase memory in AWS Production server #1111

Closed
maneshdas opened this issue Feb 16, 2018 · 8 comments

Comments

@maneshdas
Copy link

Hello,

Unexpectedly terminating Node process due to out of memory issue and tried to extend memory size by setting Node - V8 option "--max_old_space_size". It works as expected in some machines but NOT consistent across machines and different applications (NOT working in pre-prod which is in AWS). Sometimes it decreasing memory too.
Doest it depending on any other factors? Kindly advice.

Node version - 4.5

Thanks!

  • Node.js Version:
  • OS:
  • Scope (install, code, runtime, meta, other?):
  • Module (and version) (if relevant):
@bnoordhuis
Copy link
Member

You say it doesn't work. Can you be more specific? What does and doesn't it do?

@maneshdas
Copy link
Author

Hi,

It works in Mac OSX and increase the memory limit upto 3.97GB after setting the Node option "--max_old_space_size = 4096".
The same Node option tried in the AWS pre-prod server and it changed to 1.97GB only.
When I am trying "--max_old_space_size = 6144" (for 6GB) in Windows machine, it decreases memory limit to 1.31GB.

All the above different Node memory options I tried on the same Node application which is running on Windows, Mac OSX and AWS cloud server.

Thanks!

@bnoordhuis
Copy link
Member

Let me guess: the machines where it doesn't work are 32 bits? Or at least the node binary is?

32 bits binaries can only address up to 2 or 3 GB, depending on the kernel configuration.

@maneshdas
Copy link
Author

The installed Node.JS is 64 bit, checked through PM2 tool & node -p "process.arch".

@bnoordhuis
Copy link
Member

I think this might be a resurfacing of nodejs/node#648. It's not exactly the same issue but close: it's using a 32 bits signed int to store --max_old_space_size, which doesn't work for values >= 2^32 and behaves erratically for values >= 2^31.

@gireeshpunathil
Copy link
Member

@maneshdas - is this still outstanding?

@gireeshpunathil
Copy link
Member

closing due to inactivity

@jpmontez
Copy link

This is occurring to me, too. The flag is being ignored. The only workaround is the explicitly set the environment variable directory.

export NODE_OPTIONS="--max-old-space-size=8192"

All subsequent Node.js commands will now work without running out of memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants