[webkit-dev] High web process CPU usage

Chris Aljoudi chris at chrismatic.io
Wed Jul 20 19:30:24 PDT 2016

Hi all,

In the Safari shipped with the latest macOS Sierra beta, as well as Safari Tech Preview 9, there's an odd CPU usage issue with individual tab's web processes.

For example, if one navigates to huffingtonpost.com <http://huffingtonpost.com/>, Activity Monitor will show the tab web process continually using 5-10% of CPU, along with hundreds of idle wake-ups. Even more concerning, this continues to happen with the huffingtonpost.com <http://huffingtonpost.com/> web process even if one picks another tab in the window.

Here's a screenshot from Activity Monitor; one Safari window is open. It has two tabs: polymail.io <http://polymail.io/>, and about:blank <about:blank>. about:blank <about:blank> is the one currently in focus.

To investigate, I opened Web Inspector and recorded the JS/event timeline. I found that there were timers firing quite frequently.

Now, I know Safari/WebKit should be throttling timers of background tabs anyway, but I figured I'd `clearInterval` all the timers to see if that reduces the CPU usage. Nope (even though I verified no timers are firing any longer after clearing all the intervals — no activity on the timeline whatsoever; CPU usage and idle wake ups still way too high).

This doesn't happen with *every* page, but it happens with most that are reasonably complex (can't tell what the trigger is yet; perhaps the use of JavaScript timers?)

The previous Sierra beta's Safari and Tech Preview 8 both showed this problem. I don't know whether it goes further back.

Any ideas what's going on? Is this 'expected behavior' and I'm missing something obvious?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20160720/b50d587e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-07-20 at 5.02.43 PM.png
Type: image/png
Size: 101888 bytes
Desc: not available
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20160720/b50d587e/attachment-0001.png>

More information about the webkit-dev mailing list