You are not logged in.

#1 2010-01-13 18:56:19

Gerenuk
Member
Registered: 2009-12-02
Posts: 15

Kill firefox when system memory runs out

How can I tell my Linux to kill the firefox process when I run out of memory?

Something in firefox is leaky, but thats another issue.

Usually when firefox eats up all the memory, the system freezes completely and starts accessing the harddrive endlessly. In the most lucky cases after a long time it continue by kill the X server.

How can I set it up to not freeze, but rather kill firefox?

Offline

#2 2010-01-13 19:20:15

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Kill firefox when system memory runs out

Try "echo 15 > /proc/`pidof firefox`/oom_adj".

Offline

#3 2010-01-13 21:02:01

Gerenuk
Member
Registered: 2009-12-02
Posts: 15

Re: Kill firefox when system memory runs out

Thanks. I'll try that.

Do have an idea how to free the space if firefox forgets to release it?

Sometimes even after closing down it seems to keep occupying it.

Last edited by Gerenuk (2010-01-13 21:08:12)

Offline

#4 2010-01-13 21:44:14

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Kill firefox when system memory runs out

Check with htop and dstat (in AUR) what happens with your system.

That oom trick might not help at all, because it only tells the out-of-memory killer to prefer to kill firefox when you're running out of memory, but it might get killed only after your system has been unresponsive (swapping in/out) for a while. If you can't tame firefox (perhaps it's extensions' fault?), you might write a script which checks firefox memory usage and kills it when it's too high.

How much RAM/swap space do you have?

Offline

Board footer

Powered by FluxBB