0

I think this is a common use case: You have an OS running many applications and the most important app running is both, very memory intensive and at the same time performance critical. You may want to allocate some containers reserving a lot of memory to prevent reallocation (for e.g. on vector::push_back) or you want to create some arenas to allocate specific objects in consecutive memory addresses.

In this case you can enable memory overcommitting for the whole system but not for individual processes. E.g. echo 1 > /proc/sys/vm/overcommit_memory or sysctl vm.overcommit_memory=1. Is there a way to achieve the same for a single application only?

Is there a way to only allow one specific application overcommitting?

Patrick Fromberg
  • 1,313
  • 11
  • 37
  • I don't think that's possible, but have you considered using `oom_score_adj` instead (this can be applied to a single process)? – javierlga Feb 24 '23 at 21:16
  • I would prefer to kill the "other" application that overcommitted first, not the one that exhausted non-virtual memory. The later is more likely to be critical than the former. – Patrick Fromberg Feb 24 '23 at 21:43

0 Answers0