4 ms·
No information about design philosophy, whether it triggers on RSS or virtual memory. And I'd think adding swap would be recommended as a place to stow away the
by rini17 1y ago
No information about design philosophy, whether it triggers on RSS or virtual memory. And I'd think adding swap would be recommended as a place to stow away these stopped processes?
Naive approach might end with deadlock when all processs that could free up memory are stopped.
- otterley 1y agoNot only that, but it’s inherently racy (TOCTOU); a process could allocate a huge block of memory between the time the determination to allow the controlled program to start and the time that program is able to finish initializing is made. A better solution is to use a proper memory-reservation scheduler, not hacks like this. Kubernetes has such a thing.
- menaerus 1y agoIt's pretty naive, it cat's from /proc/mem and extracts MemTotal and MemAvailable: https://github.com/surban/memstop/blob/master/memstop.c#L40-L43 https://github.com/surban/memstop/blob/master/memstop.c#L40-.... In other words, that's not how virtual memory works. And I actually don't know how I would go and solve this problem because of the way commit, overcommit, and paging algorithms can intervene with the goal.