What is the problem this feature will solve?
I have a server that's been OOMing when it hits the Docker memory limit I set of 2GB. I had set --max-old-space-size=432 --max-semi-space-size=16 --heap-snapshot-on-oom but Node isn't logging OOM or creating a heap snapshot so I think the issue is too much buffer allocation.
It sure sucks that there's no surefire way to get diagnostic information if too many buffers get allocated.
What is the feature you are proposing to solve the problem?
I'm not 100% sure if this is possible but a --max-memory or --max-rss flag that would set a limit on the resident set size would be really great. If V8 heap, buffer, or C++ external object allocation would push the resident set size over this limit, Node would make a heap snapshot if --heap-snapshot-on-oom is set, and then exit.
What alternatives have you considered?
I will have to try polling process.memoryUsage() and taking my own heap dump if the memory is getting too large, but I think sudden buffer allocation is OOMing after only a few seconds so I'm not sure it will even work.
What is the problem this feature will solve?
I have a server that's been OOMing when it hits the Docker memory limit I set of 2GB. I had set
--max-old-space-size=432 --max-semi-space-size=16 --heap-snapshot-on-oombut Node isn't logging OOM or creating a heap snapshot so I think the issue is too much buffer allocation.It sure sucks that there's no surefire way to get diagnostic information if too many buffers get allocated.
What is the feature you are proposing to solve the problem?
I'm not 100% sure if this is possible but a
--max-memoryor--max-rssflag that would set a limit on the resident set size would be really great. If V8 heap, buffer, or C++ external object allocation would push the resident set size over this limit, Node would make a heap snapshot if--heap-snapshot-on-oomis set, and then exit.What alternatives have you considered?
I will have to try polling
process.memoryUsage()and taking my own heap dump if the memory is getting too large, but I think sudden buffer allocation is OOMing after only a few seconds so I'm not sure it will even work.