[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Dealing with a memory leak
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2009-11-21 17:38:43
Message-ID: 200911211838.43539.l.lunak () suse ! cz
[Download RAW message or body]

On Thursday 19 of November 2009, Anne Wilson wrote:
> Is there any way at all that I could set an alarm when available swap
> memory reaches a certain low point?
>
> I have been having some horrible freezes for the last 2-3 weeks.  Basically
> the system would suddenly become unresponsive.  A mouse click would take
> literally two minutes to activate, and it was almost impossible to get
> keystrokes to be accepted at all.  Whenever I managed to see what was
> happening in top there was nothing obvious in the applications list, but
> memory was totally used, including swap, with 0% available.  If I could
> catch it in time recovery was possible, but if it gets to 0% reboot seems
> to be the only way out.

 In short: It's the Linux kernel's fault and it horribly sucks at this. The 
system becomes unresponsible because with memory full the system get 
completely busy with just moving things between RAM and disk (swap), and one 
of the things that is broken is that the kernel needs ages to realize that 
something is wrong. As soon as it eventually manages to find out, OOM (Out Of 
Memory) killer is started to pick a process to be killed, which should remedy 
the situation. Here again it needs quite a while to make up its mind and 
(especially with KDE) it often decides to kill completely innocent vital 
processes first. It's been broken like this for ages and apparently nobody 
capable of fixing it cares :(.

 Before rebooting, you can try using SysRq+F to manually trigger the OOM 
killer, which should save some time. We have a hack in kdelibs to protect 
kdeinit (which often used to be the target), but basically there's no good 
workaround.

 If you know what process is likely to cause this, you can also run it with a 
memory limit set using 'ulimit'.

> So - I suspect nspluginviewer.  I haven't yet searched for bug reports -
> I'll do that today - and I need to gather more info before I attempt to
> file one, but the greatest help, for now, would be some way to warn me when
> the swap available gets below, say 250KB.  The last bit of swap seems to
> disappear so quickly that I need to react  immediately to save work.

 You probably mean 250MB there - with 250KB left you're already out of luck.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak@suse.cz , l.lunak@kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http://www.suse.cz
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic