[opensuse-support] Prevent system unresponsive state on huge memory consumption
Hi, I've tried to compare two XML (each roughly 3MiB in size) using `xmldiff`. But this program have eaten whole RAM and swap and ended up in unresponsive system and then crashed almost everything — X session with all applications — so I've got just tty's. "Nice". Is there any way to prevent such behaviour in future? There is ulimit, but I don't want to limit all of my processes. Nice solution is (IMO) would be to allow every process to reach some limit after which application would be stopped (not killed), some notification sent (if possible) and user (me) could make some decision what to do with it — kill, allow once, add to white list. If program is white-listed allow it to do anything until ulimit/OOM-killer behaviour. Is there any way to do this? I'm not expecting absolutely ready solution, but at least some direction how I can achieve this. The only solution I'm aware of and could do — make some daemon that periodically checks process memory usage and sends SIGSTOP if some of them uses too much, but I'd prefer not use this approach — there is no perfect time period — high CPU usage vs too late to do anything. -- Kind regards, Mykola Krachkovsky -- Найкращі побажання, Микола Крачковський
On 12/09/2018 07.41, Mykola Krachkovsky wrote:
Hi,
I've tried to compare two XML (each roughly 3MiB in size) using `xmldiff`. But this program have eaten whole RAM and swap and ended up in unresponsive system and then crashed almost everything — X session with all applications — so I've got just tty's. "Nice".
Is there any way to prevent such behaviour in future? There is ulimit, but I don't want to limit all of my processes.
Not all processes, just those that run on /that/ terminal. In my notes, I have this for running this particular program that ate memory: cer@nimrodel:~> ulimit -v 300000 cer@nimrodel:~> kbabel
Nice solution is (IMO) would be to allow every process to reach some limit after which application would be stopped (not killed), some notification sent (if possible) and user (me) could make some decision what to do with it — kill, allow once, add to white list. If program is white-listed allow it to do anything until ulimit/OOM-killer behaviour.
Is there any way to do this? I'm not expecting absolutely ready solution, but at least some direction how I can achieve this. The only solution I'm aware of and could do — make some daemon that periodically checks process memory usage and sends SIGSTOP if some of them uses too much, but I'd prefer not use this approach — there is no perfect time period — high CPU usage vs too late to do anything.
Not that I know. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
середа, 12 вересня 2018 р. 18:42:25 EEST Carlos E. R. написано:
Not all processes, just those that run on /that/ terminal. Yes, sure, all — when it's set in /etc/profile[.d], cause it usually unexpected. Well, I haven't expected that xmldiff will consume more than 20GiB of RAM+swap. And similar happened to me with LibreOffice. So I'd prefer to make user-wide and add some known memory eaters (like games, IDE's) to white list.
Not that I know. Pity. Maybe someone do? If that could be done using some system calls, just guide me, I'll try to make program for that.
-- Kind regards, Mykola Krachkovsky -- Найкращі побажання, Микола Крачковський
On 13/09/2018 04.32, Mykola Krachkovsky wrote:
середа, 12 вересня 2018 р. 18:42:25 EEST Carlos E. R. написано:
Not all processes, just those that run on /that/ terminal. Yes, sure, all — when it's set in /etc/profile[.d], cause it usually unexpected. Well, I haven't expected that xmldiff will consume more than 20GiB of RAM+swap. And similar happened to me with LibreOffice. So I'd prefer to make user-wide and add some known memory eaters (like games, IDE's) to white list.
Not that I know. Pity. Maybe someone do? If that could be done using some system calls, just guide me, I'll try to make program for that.
I don't know enough about that area, sorry. It's an idea for a systemd thing ;-) That rings a bell. But I don't remember the bell's name. Something about grouping processes... -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas)) -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
participants (2)
-
Carlos E. R.
-
Mykola Krachkovsky