Open
Description
Version
v20.9.0
Platform
linux 6.2.7-060207-generic
Subsystem
No response
What steps will reproduce the bug?
const memoryHog = [];
setInterval(async () => {
const mem = process.memoryUsage();
console.log(mem);
memoryHog.push(new Array(20000000).fill({ foo: Date.now() }));
}, 5000);
node --heapsnapshot-near-heap-limit=800 --max-old-space-size=1000 script.js
How often does it reproduce? Is there a required condition?
It always happens
What is the expected behavior? Why is that the expected behavior?
I expected node to generate a heap snapshot when the memory usage approached the specified limit, allowing analysis of memory allocation before the process was terminated duo to heap OOM
What do you see instead?
Node uses all of the host system resources, and the Node process is killed by the operating system before a heap snapshot can be generated, preventing analysis of the memory usage pattern that leads to the crash.
Additional information
I have 16GB of ram and it should be enough to generate a heap snapshot of a node process with 1GB use of heap
Metadata
Metadata
Assignees
Labels
No labels