You are not logged in.

#1 2012-08-29 03:00:14

V01D
Member
Registered: 2006-07-18
Posts: 128

Better OOM managment: how to avoid trashing?

Hi,
I've had many problems in the past where my laptop (2.5GB RAM and about 2GB swap) completely FROZE for several minutes, completely unresponsive whenever some runaway process decided to start consuming all my memory. Until the swap wasn't completely full (this takes a while, my disk is not very fast) the OOM killer was not invoked. To experiment with a different configuration I now deactivated swap and now whenever a runaway program decides to eat all RAM the OOM killer is executed and the system responds faster.
But... (as I understand) the problem is that, since the RAM is full, the kernel needs to dump filesystem cache to disk to make room for invoking the OOM and such. At least what I perceive is high disk usage (as if swapping was ocurring) until the runaway process is killed. Now this is better than before but I would like to avoid this unresponsivness.

My ideal goal is that the kernel performs the OOM killer with a bit of room to spare in order to maintain the system responsive. I don't care about the app dying, it generally selects the correct app with loads of memory being consumed. Also, I don't care about not using swap, for my usage 2.5Gb suffices for all my apps and my disk is slow enough to withstand swapping.

So, is it possible to configure the system for the OOM killer to be invoked earlier? I've read about disabling overcommit but the system crashes with this, so it is not a safe possibility.

Thanks!

Offline

#2 2012-08-29 03:22:21

progandy
Member
Registered: 2012-05-17
Posts: 5,205

Re: Better OOM managment: how to avoid trashing?

You can set global or per-user limits with /etc/security/limits.conf. The manpage has further details.

Last edited by progandy (2012-08-29 03:23:08)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2012-08-29 09:41:51

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: Better OOM managment: how to avoid trashing?

But with overcommitting is the memory exhaustion problem correctly tackled by limitting memory size per-process?

Offline

#4 2012-08-29 09:55:04

progandy
Member
Registered: 2012-05-17
Posts: 5,205

Re: Better OOM managment: how to avoid trashing?

V01D wrote:

But with overcommitting is the memory exhaustion problem correctly tackled by limitting memory size per-process?

This should stop the runaway processes to consume too much memory, it doesn't change the behaviour of the oom killer.
If you want only specific processes to be limited, launch them with a shellscript that calls ulimit and afterwards execs your process.

Last edited by progandy (2012-08-29 09:57:46)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2012-08-29 09:57:52

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: Better OOM managment: how to avoid trashing?

Ok, so the problem can persist. If the process eats less than the per-process ammount and the RAM is exhausted the OOM killer will be invoked.

Offline

Board footer

Powered by FluxBB