Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Damn you OOM Killer!!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Mon Aug 09, 2010 2:25 pm    Post subject: Damn you OOM Killer!! Reply with quote

I'm running a recent beta of Opera and it has a memory leak issue; I'm sure it will be fixed eventually, but in the meantime it's triggering some very nasty behavior in the kernel, namely the dreaded OOM Killer! :O

When it's triggered, I'd expect it to take out Opera, but not only does it kill opera but apache, qtorrent, thunderbird, VirtualBox and several instances of kedit and rxvt!

Is there something I can do about this, e.g. to make it only kill Opera and not go on a mad killing spree with my other apps? :S
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Mon Aug 09, 2010 3:01 pm    Post subject: Reply with quote

Yeah sure there's an easy solution. Don't run Opera. Or at least not a beta that leaks memory that badly.

An alternative may be adding more swap. If the leaked areas are large enough they can simply be paged out and never ever be paged in again, keeping your physical memory free of bloat.

Yet more obscure alternative is to have a script running in the background that checks Opera's memory usage frequently, and kills it directly before it grows big enough to trigger OOM. However this will only work if the leakage is somewhat continuous... if it just allocated too much memory instantly there is no easy way to react to it in a script.

Whether it's possible to set "preferred" applications for OOM, I don't know.
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Mon Aug 09, 2010 3:47 pm    Post subject: Reply with quote

That's the bizarre thing; The swapfile doesn't even get touched!

It just fills up RAM then kills a semi-random set of processes. TBH I'm not very happy about that behavior - Even once Opera is fixed, it'll still be there - So I want to find out what I could do..

I suspect there's some low-memory allocation problems going on which is why the swap isn't even being touched, but how to fix that and/or disable the oom-killer or make it only kill the process with the largest RAM allocation or lower priority processes or something would be better solutions for me...
Back to top
View user's profile Send private message
xibo
Apprentice
Apprentice


Joined: 21 Aug 2007
Posts: 152
Location: moving between kubuntu and ubuntu kde edition

PostPosted: Mon Aug 09, 2010 4:13 pm    Post subject: Reply with quote

GDB can set rlimits for programms it runs... Why not run opera in gdb ( don't know if that works )?

If opera is not swapped it's probably doing accesses to all of it's memory pages regularily, which would be weird, but could happen nevertheless
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Mon Aug 09, 2010 4:50 pm    Post subject: Reply with quote

Cyker wrote:
That's the bizarre thing; The swapfile doesn't even get touched!


Two possibilities... you set swappiness to zero. Or the memory is allocated in a way that can not be swapped. Programs are allowed to do that, some even need to do that (for example memtester, if it allows its allocated memory to be swapped out, how can it reliably test the physical memory?). Of course combining that with a memory leak is absolutely deadly.

Which brings us back to square one: If the Opera Beta is that bad do not use it! Wait for them to fix the issue!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9882
Location: almost Mile High in the USA

PostPosted: Mon Aug 09, 2010 5:19 pm    Post subject: Reply with quote

Perhaps ulimiting opera's memory may help temporarily?

ulimit -m 262144 # use 256MB memory for this shell and subshells from now on.
ulimit -d 262144 # let data size get no more than 256MB

While this is not the proper solution it may help a little.

This is weird though, opera should not lock its pages... I can see virtualbox/vm's wanting to lock pages in RAM.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
zeek
Guru
Guru


Joined: 16 Nov 2002
Posts: 480
Location: Bantayan Island

PostPosted: Thu Aug 12, 2010 4:17 am    Post subject: Reply with quote

Try this:
Code:

echo 15 > /proc/<pid_of_opera>/oom_adj


That should guarantee that Opera is killed the next time this happens. Useful for more than Opera ...

This is good reading to understand OOM killer:

http://lwn.net/Articles/317814/
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Thu Aug 12, 2010 4:51 am    Post subject: Reply with quote

You can also disable memory overcommit.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum