FATAL ERROR: Reached heap limit — Allocation failed - JavaScript heap out of memory.
V8 heap (default ~4GB on 64-bit) exceeded — leak or genuinely big workload.
node --max-old-space-size=8192 server.jsnode --heap-prof # then open in Chrome DevToolscreateReadStream / pipeline # not readFile on 2GB JSONconst { Worker } = require("worker_threads")Load-test before shipping; alert on RSS growth slope.
Spinning up a fresh box to reproduce or escape this error?
Servers with headroomNinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.
Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog