Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling linux memory overcommit inside an application

You can adjust the memory overcommit policy system-wide via sysctl calls, but is it possible to adjust this policy on a per-process basis from within the process itself?

I want to make one particular real-time process never use overcommit, though the rest of the system can overcommit.

like image 686
Joe Avatar asked Nov 05 '22 09:11

Joe


1 Answers

No, it's not possible.

Somewhat related, for a real-time process, you probably want to use the mlock or mlockall functions to pin your address space to RAM.

like image 157
janneb Avatar answered Nov 09 '22 06:11

janneb