NodeJS - JavaScript heap out of memory
Last updated
Was this helpful?
When running the SeaLights NodeJS agent, the error "JavaScript heap out of memory" is encountered.
By default node is limited in the amount of memory it is allocated, and sometimes the SeaLights node agent requires more memory that what was allocated.
More memory can be allocated by using the max-old-space-size flag.
The flag can be passed either by using the NODE_OPTION environment variable, for example:
export NODE_OPTIONS=--max-old-space-size=4096set NODE_OPTIONS=--max-old-space-size=4096Alternatively, it can be passed directly to node process running the SeaLights agent, for example:
node --max-old-space-size=4096 ./node_modules/.bin/slnodejs scan ...To show the current max heap size being used by Node.js at runtime (after accounting for NODE_OPTIONS or any CLI overrides), you can execute:
node -p "v8.getHeapStatistics().heap_size_limit / 1024 / 1024 + ' MB'"Running Tests (Go)
Setting up a windows service (.Net Core)
Setting up IIS Listener (.Net Core)
Cloud Foundry Integration (Python)
Last updated
Was this helpful?
Was this helpful?

