In Linux, cgroups (a kernel feature) allows to limit the resources (cpu, memory…) accessible to a group of processes. I have written a little bash script that will either:
- create some groups for the current user session and assign some restrictions. No need to be root or to modify a global configuration file. Call it when your desktop session starts (for example by putting an entry in «~/.kde/Autostart»). Edit the script to create your own groups.
- start a process in one of theses groups
The main reason was that I encountered a bug with Firefox and Google+, with triggered infinite memory allocation, which freezes my machine for a few minutes (because of the trashing). I hope that it will allow me to kill the process/close the tabs if it happens again.
Continuer la lecture