[Webkit-unassigned] [Bug 26641] Safari consumes 100% CPU after leaving GMail open (gmail is installing a billion timers)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 25 14:14:53 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=26641





--- Comment #9 from Dmitry Titov <dimich at chromium.org>  2009-08-25 14:14:51 PDT ---
Probably similar to Bug 23865 (at least from WebKit perspective).

There are 2 issues with timer queue:

1. if there are enough (not bazillion) timers that total time of their
processing becomes larger then the typical 'next time firing' set in the
application, the page starts to consume 100% CPU, not necessarily growing the
number of timers. It's a bad application, not sure browser can help here, limit
won't work because all you need is 10 timers with 100ms work each rescheduling
itself to repeat in 1000ms.

2. the number of timers can explode, caused by non-trivial problems like a
fixed-interval timer that schedules a web of short-delay timers to do the
pieces of work (avoiding UI block), and unfortunate conditions when all those
timers have too much work as in #2 - the total number of timers grows then. Or
it can be just a plain bug, something like a timer creating 2 timers
recursively.

In case #2, when the number of timers grows, the user input can be starved
pretty quickly to the point that it'll be hard to even close the page. The fix
for that is attached to bug 23865.

It's not clear to me how to limit the number of timers. Obviously it has to be
per-DOMWindow, but what's the limit? Too much depends on what actually is done
inside the timer's callback and how often timers are scheduled, so some
constant could be too small or too big. Doing some dynamic limit based on
measuring processing times may cause applications to randomly stop working for
reasons like occasional swapping... JS in general allows resources to be
allocated while there are resources, provided user is always in control (can
close or reload the window).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list