Currently, --max-old-space-size requires a fixed memory value in MB. However, in containerized environments (e.g., Docker, Kubernetes), available memory can vary dynamically. Introducing a percentage-based option would allow Node.js to adjust its memory usage relative to total system memory, reducing the risk of OOMKills while optimizing performance.
Why is this needed?Introduce a new syntax for --max-old-space-size, allowing it to accept a percentage of total system memory, e.g.:
Example Behavior:
I’m new to contributing to V8 and would appreciate any guidance on the best way to approach this change. Specifically:
Looking forward to your feedback and help! 🚀
--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/v8-dev/e44b0fcd-35a2-4d81-84df-a2fecdabd33en%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/v8-dev/a8fb7122-b63d-4fdf-9e3f-f46ac9e69bcbn%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/v8-dev/CAJFGqfN%3DFRm7b1bS7F%2B6tXUjjZNzAx8Nkk52XGCA80L1zj%2BNhw%40mail.gmail.com.
On Thu, Mar 20, 2025 at 12:36 PM Omer Katz (chromium.org)
<omer...@chromium.org> wrote:
>
> My personal opinion is that your proposal doesn't make things worse (as you've also mentioned in the node discussion) but, since percentages can be converted to MB before reaching V8, I don't see the motivation for adding this to V8.
> I personally disagree with bnoordhuis that V8 is the better place for it and I think it makes more sense to have it as a wrapper downstream (i.e. in this case in node).
The downside of doing things downstream is that only node benefits,
not other embedders like Chrome or Deno....
...but the counterargument to that is that node will likely do a
better job than V8, unless V8 is willing to go all in on cgroups
parsing, like OpenJDK. Node gets that for free from libuv.
--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/v8-dev/CAHQurc-ejataSugnX2O%3D3jjtrtjhEg-7ta34ARApfMh4SEf76w%40mail.gmail.com.