V8 idle heap release to operating system for low-traffic Node.js workloads
0 reputation · 28 Oct 2020, 07:23 UTC
V8 idle heap release to operating system for low-traffic Node.js workloads
The goal is to reduce resident memory cost for a long-running Node.js process that serves only a few requests per hour. V8's Orinoco generational garbage collector can retain allocated old-space pages after a collection cycle, and --max-old-space-size bounds heap growth without requiring unused memory to be returned to the OS.
The unresolved behavior is whether idle heap pages are released back to the system without explicit intervention, and whether releasing them increases latency on the first request after a long idle period. Version assumption: current V8 releases in Node.js LTS. Practical verification: observe resident set size before and after an extended idle period that includes a major collection cycle.
Does V8 return unused old-space memory to the operating system after an idle major collection? Can heap release be forced without increasing latency on the first request after extended inactivity? What is the expected interaction between --max-old-space-size and resident-set retention for sparse, latency-sensitive traffic?