Occassionally, I run a command that hogs RAM and brings my system to a grind. Even pressing Ctrl-C takes 20 minutes to register, because the system is busy swapping to disk.

What solutions are available?

I have some ideas, but don't know exact solutions:

  1. Give maximum priority to the window-manager and system processes, while giving a lower priority to all other processes.

  2. Run a watch-dog process with highest priority that watches for runaway process behaviour. I remember KDE used to have such a tool couple of years back. Is there a modern (GNOME/Unity) equivalent?

  • How about using Ctrl + \ in place of Ctrl + c? – jobin May 31 '14 at 7:20
  • @Jobin what does that do? – HRJ May 31 '14 at 7:24
  • Have a look at this question. – jobin May 31 '14 at 7:27
  • @Jobin Ah thanks. I didn't know about it. But in my case, the process is responding to Ctrl-c, but the system itself has slowed down, and the Ctrl-c reaches the process very slowly. – HRJ May 31 '14 at 7:29

Read man bash or info bash and check out the ulimit bash command. It will let you limit your processes in many ways.

Also see this link about Hard and Soft ulimits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.