This could be that our worker pool is unbounded. If a new task gets
dispatched to the worker pool and no worker threads are available to
do it, we just start a new thread without regard for what sort of
shape we’re in thread-wise.
Possibly DNS resolution in WorkerPool? I believe that's why Safari
can have thousands of simultaneous threads. Back when we used
OSX-specific code, the system capped the number of outstanding threads
based on available computing resources, and I was never able to fully
convince myself that that was the right thing to do for DNS
resolution, which is mostly waiting around, but I can see that
approach being full of fail once you're spawning so many threads that
their numbers are a problem.
-scott
If a new task getsdispatched to the worker pool and no worker threads are available to
do it, we just start a new thread without regard for what sort of
shape we’re in thread-wise.
Very interesting blog post: http://gregor-wagner.com/?p=79In short, opening 150 tabs in Chrome/Mac takes a long time and results in excessive CPU and memory use.Particularly interesting was that when the test script was made to open pages in a way that allowed them to be in new processes, there were 43 renderer processes, but "Some processes only host 2-3 sites and one process hosts about 50% of all sites." Also, "The main Google Chrome process has 368 threads with 150 open sites and up to 420 during browser shutdown."This sounds like at the very least,
- We may have a bug in our page -> process allocation code such that too many things are getting dumped into one process
It certainly could be worker pool threads, however note that we limit
the number of outstanding DNS requests to 8, so there shouldn't be an
unbounded explosion of threads from this. (It is possible to exceed 8
parallel DNS threads by cancelling requests, but doesn't sound like
the test-setup is tickling that).
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
On Thu, Aug 4, 2011 at 12:46 PM, Peter Kasting <pkas...@google.com> wrote:Very interesting blog post: http://gregor-wagner.com/?p=79In short, opening 150 tabs in Chrome/Mac takes a long time and results in excessive CPU and memory use.Particularly interesting was that when the test script was made to open pages in a way that allowed them to be in new processes, there were 43 renderer processes, but "Some processes only host 2-3 sites and one process hosts about 50% of all sites." Also, "The main Google Chrome process has 368 threads with 150 open sites and up to 420 during browser shutdown."This sounds like at the very least,
- We may have a bug in our page -> process allocation code such that too many things are getting dumped into one process
I'll investigate this one.Charlie
(Another note from running the test myself-- Chrome does indeed get *very* slow with 150 tabs, and it would be great to find ways to improve it.)
Yes, the Task Manager was visible when I ran it the first time. I'm running it again without the Task Manager showing, and it's still very slow, even on a fairly powerful desktop.Do you suspect the Task Manager is one of the contributing factors?
That's because we get our information out of parsing /proc/<pid>/. The
code that does this is in base/process_util_linux.cc and the bulk of
the time is running GetWorkingSetKBytes which has to read smaps files.
I don't know if there are any kernel interface here or how this could
be improved.
-- Elliot
I personally use tons of tabs, and found Chrome to be very slow in handling startup, since it tries to open them all at once rather than spreading them out.
When I previously mentioned issues with lots of tabs, I was pointed to a doc showing that most users only had a few tabs and it was implied my usage wasn't one that we particularly cared about supporting. If that is different now, then I can report various problems.
Sadly, I think /proc is supposed to be the kernel interface for this on Linux.
I'm not sure I'd describe our attitude as "don't care" so much as "this is rare enough that we should allocate resources accordingly". I'd rather fix a less serious bug that hits tons of users than one that's more crippling but only at >100 tabs. However, that doesn't make the latter unimportant, and I thought we at least used to be usable at large numbers of tabs, so I'm concerned that (a) this may be a regression and (b) there may be low-hanging fruit here that can at least get us up to par with Firefox.
As far as simple things that would help make it more usable with lots of tabs,