You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Get usable memory from cgroups, etc. #2286
As cgroups (and possibly other kernel-level resource limits) may specify a limit on the amount of memory a process can consume, it would be useful for this library to expose an API like uv_get_usable_memory (in addition to total and free). Node.js would be able to then use this to set a memory limit for V8 isolates (see nodejs/node#27508).
I've put something together for linux/cgroups here. I wanted to get feedback before taking time to flesh it out more. In particular, I think if we introduce this API, that we could iteratively implement it for other OS's besides Linux, and in the meantime just return a very high value as a place holder (cgroups itself uses a value of 0x7FFFFFFFFFFFF000 to represent no memory limit).
Activity
kjin commentedon May 1, 2019
cc/ @ofrobots, @bnoordhuis, @mscdex
cjihrig commentedon May 2, 2019
I'm not opposed to such an API. If we do add it, we might want to label it as experimental for a few releases though.
unix,win: add uv_get_constrained_memory()
unix,win: add uv_get_constrained_memory()
unix,win: add uv_get_constrained_memory()