0

I recently ran into a situation where a system was too out-of-memory to even run pkill or htop, or to even create a swap file.

(But somehow I could still SSH into the system, so at least I had a shell.)

I ended up getting lucky by noticing that I could run ps and kill if I don't run the login shell, but I'm wondering if I hadn't been lucky, what could I have possibly done to avoid rebooting, assuming I still had the login shell?

Is there e.g. to reserve a specific amount of memory for a particular executable to always be able to run? Or is there a way to kill processes from within Bash that doesn't require a fork?

user541686
  • 3,033
  • 5
  • 28
  • 43
  • look at this: https://unix.stackexchange.com/questions/44985/limit-memory-usage-for-a-single-linux-process#125024 – Arpit Agarwal Nov 11 '17 at 20:40
  • Probably this will help you: [how to create a user with limited ram usage](https://unix.stackexchange.com/questions/34334/how-to-create-a-user-with-limited-ram-usage) – FaxMax Nov 11 '17 at 20:43

0 Answers0