You are not logged in.

#1 2016-04-24 14:13:16

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

[SOLVED] Avoiding running out of memory

Hello,

I have Arch installed on my laptop with 8GB RAM and from time to time I get into a state when I totally run out of memory (e.g. when doing some data science and opening a lot of tabs in Chromium). What bother me is that when I get into that state, my laptop is of course unusable and sometimes I am not even able to just get into a problematic window and kill it without waiting 20 minutes. I just have to do a hard reset.

Is there a way how to prevent this, e.g. automatically kill a specific process (or a process with highest memory consupmtion)? Would swap on my SSD help me, or would it be the same (I am currently not using any swap device)? Some script I could use which would notify me about running out of memory?

Thanks

Last edited by Kotrfa (2016-04-29 13:10:47)

Offline

#2 2016-04-24 14:59:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [SOLVED] Avoiding running out of memory

Is there a way how to prevent this, e.g. automatically kill a specific process (or a process with highest memory consupmtion)?

The kernel already has a method to do that, it's called OOM killer (Out Of Memory killer).

I do have the impression that having a swap-device or swapfile improves the performance of the OOM killer,but no hard data about it.
Worst case using a swapfile / swapdevice on an SSD will mean there will be a noticable slowdown before the system becomes totally unresponsive.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2016-04-24 21:23:27

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: [SOLVED] Avoiding running out of memory

I've looked at this before, but never actually done anything:

http://superuser.com/questions/406101/i … nt-earlier
https://www.google.co.nz/search?q=makin … e&ie=UTF-8
https://github.com/rfjakob/earlyoom

There's an AUR package for the last link, perhaps give that a go?

Offline

#4 2016-04-29 13:03:54

Kotrfa
Member
Registered: 2012-10-25
Posts: 213

Re: [SOLVED] Avoiding running out of memory

Thanks for references and links.

Earlyoom seems to do exactly what I want. I tested now and it works (installed from AUR).

Last edited by Kotrfa (2016-04-29 13:10:37)

Offline

Board footer

Powered by FluxBB