[lkml]   [2002]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: Killing/balancing processes when overcommited

On Thu, 12 Sep 2002, Giuliano Pochini wrote:
> It's not difficult to make the kerner choose the right processes
> to kill. It's impossible.

Not quite. But it's expensive. It adds 4 bytes per task, plus a second
OOM killer.

> Imagine that when it goes oom the system stops and asks you what
> processes have to be killed. What do you kill ?

Rather whom would you ask?

> Probably we do need an oomd that the sysadmin can configure as he likes.

That's bad, it could get killed. ;-)

Mostly the mem eaters are those who hang in an malloc() deadloop.

char *x = NULL;

* We need this variable, so if we don't get it, we reallocate it
* regardless of what happened.
do {
x = malloc(X_SIZE);
} while (!x);

That's possibly a candidate.

So if we just count how often per second that stubborn process uses
malloc(), you'll catch the right guy most of the time. If you don't get
a process that's over the threshold, do usual OOM killing...

--./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .-
--/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..-
.- -/---/--/---/.-./.-./---/.--/.-.-.-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.236 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site