Question about uv_get_available_memory API #4336
-
The value of |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
I don't really understand what you're asking. If you're saying libuv is doing something wrong, please motivate why. |
Beta Was this translation helpful? Give feedback.
-
I think it is a reference to #3897, but I am increasingly uncertain that is better than the (also fairly useless) status quo. |
Beta Was this translation helpful? Give feedback.
-
I want to know how much memory the process can use before OOM. |
Beta Was this translation helpful? Give feedback.
On general-purpose multitasking operating systems that's fundamentally unknowable. uv_get_available_memory() is an educated guess, useful for diagnostics but not for policy. Reasons why:
If you're trying to write software that's robust in low memory situations, then your best best is to disable overcommit and always handle allocation failures, but even that may not always stave off the OOM killer.