0

I am using MX linux for a few days and I found a problematic behavior. Suddenly sevaral processes were killed automatically. For this, I had to face many problems. Is there any way to stop it? I don't want kill process automatically. Please help me to solve it.

3
  • Buy more memory. – Ipor Sircer Aug 11 '20 at 11:32
  • But is there no way to stop automatically process killing?I have 4 GB ram and no way to expand more memory in my laptop. – Zabir khan Aug 11 '20 at 11:37
  • Use larger swap and enjoy the slowness. – Ipor Sircer Aug 11 '20 at 11:50
1

Is there any way to stop it?

Unfortunately there isn't.

The rationale is as follows: once a system runs completely out of memory, it must freeze, because it cannot even run the simplest command - since that would require allocating memory. The OOM-Killer is designed to prevent the system from becoming completely unusable in this way by killing (based on some heuristics - others may say at random) processes to free memory. That way, an administrator can at least try to get the system back to a usable state, hopefully without having to reboot. Completely disabling this feature is not implemented (see also this answer on StackOverflow).

To alleviate the problem, you can try to

  1. Use top or any similar system monitor to investigate which program starts eating up memory. If it is one you wrote yourself, you may have created errors in the memory management that you can try to track down using tools such as valgrind. If it is a third-party program, you can try to limit its resources (see answers to this question, for example) so that it at least doesn't affect your system in general.
  2. Try to tweak the settings of the OOM killer, e.g. overcommiting, but note that this can have side effects.
  3. Increase the swap space (see comment by Ipor Sircer), but note that this will make the system very slow.

If your hardware ultimately is not up to the task, you may well have to think about upgrading.

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.