V8 option: --initial-old-space-size #4776
-
Recently, I have been using Node.js in production and want to try adjusting V8 startup parameters like JVM to improve the throughput of the service. When testing the parameter |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 5 replies
-
node version: 18.12.1 |
Beta Was this translation helpful? Give feedback.
-
You probably set it too low. It defaults to 256 or 512 MB (32 vs. 64 bits) and you can't set it higher than half the max old space size (so 350 or 700 MB unless overridden with I don't expect higher values to make much difference with most workloads. You avoid a few full GCs at startup but that's about it. Possibly useful for short-lived scripts but not long-lived services. |
Beta Was this translation helpful? Give feedback.
I don't think you can observe it directly. At best the physical_space_size value grows a little quicker than it otherwise would.
It's probably best to think of it as an input signal (but not the only one - it's complicated) that helps V8 decide how quickly to grow the heap to the max size.