rfjakob / earlyoom

earlyoom - Early OOM Daemon for Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notify-send slowdown

hakavlad opened this issue · comments

...if & not in the end of the command.

Replace
"-i dialog-warning 'earlyoom' 'Killing process %d %s'", victim_pid, victim_name);
with
"-i dialog-warning 'earlyoom' 'Killing process %d %s' &", victim_pid, victim_name);
will fix the problem

Earlyoom slowdowns until notify-send runs. Adding '&' fixes problem.

I see. But we also have to stop sending notifications until the first one is finished.

Otherwise we may spawn too many processes, and slow the system down even worse.

spawn too many processes, and slow the system down even worse

Have you seen this in fact even once?

Slowdown the system will stop after 1st SIGKILL.

Yes i have seen this with cronjobs that pile up. The server then enters a death spiral

earlyoom was sending the notification first, and kills later. As sending the notification needs memory, this was stupid. The change b2fe57c kills first, and notifies later. Does this fix the slowdown you see?

I need test it, I try it later.

Thank you very much

kills first, and notifies later. Does this fix the slowdown you see?

Works great, thanks!

Thanks for testing!

@rfjakob

Otherwise we may spawn too many processes, and slow the system down even worse.

I ran even

while true; do (notify-send lol &); done

and nothing happened.
Notify-send is very short-life process, it just quickly send info to notification daemon and die.
That's why using Popen and & seems like not dangerous.

That contradicts what you saw in #73 (comment) , right?