OOM-killer prevention for master kdeinit process

Lubos Lunak l.lunak at suse.cz
Fri Aug 4 10:13:01 BST 2006


On Thursday 03 August 2006 16:51, Josef Weidendorfer wrote:
> On Wednesday 02 August 2006 15:09, Lubos Lunak wrote:
> > ls /proc/*/oom_score | grep -v self | sed 's/\(.*\)\/\(.*\)/echo -n "\1
> > "; echo -n "`cat \1\/\2 2>\/dev\/null` "; readlink \1\/exe || echo/'| sh
> > | sort -nr +1
> >
> > That gives lines with </proc/pid> <likelyhood to be oom-killed> <binary>.
> > Run "pstree -p" and compare it with the top of the list. The very first
> > item that's going to be killed when running out of memory is going to be
> > the master kdeinit process, i.e. the tiny thingy that is linked against
> > our basic libraries which we use for launching apps. The reason why it's
> > going to be killed the first is that OOM-killing has some "smart"
> > heuristic that counts also all child processes into parent's score (it's
> > mentioned in the paper)
>
> Hmmm.... just a idea:
> Why is kdeinit not doing 2 forks to get rid of the parent relationship?

 It actually does, except for the case when it gets requests from klauncher, 
and that was rather hard to spot.

> This should help the OOM score a lot, and I see no bad thing in having
> init as parent for most KDE apps. Or am I missing something?

 No, that indeed looks like the right solution :). I'll just need to make the 
extra fork doesn't break things.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/




More information about the kde-core-devel mailing list