Thursday, 22 August 2013

How to persistently limit resources of a program

How to persistently limit resources of a program

I am running several programs on my computer and under normal
circumstances my RAM (2GB) and CPU power is sufficient. However it occurs
that a single program suddenly turns the system permanently completely
unresponsive (no alt+f1, no reisub) and I need to do a hard shut-down and
loose data. I want to be secured against such a situation.
Preferably the system would be able to keep itself alive so that the user
has control to close programs at any time (I remember in Ubuntu 9.10, the
kernel killed processes that require too much RAM).
How can I set it up to allow no program to require more than ~75% of memory?
I tried ulimit -v 1500000 but it seemed not to help (maybe not
persistent?) and I lost data again.

No comments:

Post a Comment