Windows 2000 Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 6 December 2009

The many instances of Chrome

Posted on 08:00 by Unknown
As many readers of this blog may know, Google Chrome is different from other Windows web browsers. It isolates each of its tabs into an individual process, instead of containing them all in a single multi-threaded process. Google Chrome essentially forks itself each time you create a new tab. This can easily result in 10-20 chrome.exe processes running on your system. But, don't worry -- that doesn't mean more memory or CPU use. Read on.

Fork? That's when a process creates a new running copy of itself, identical to the first. As always (fork or not), the virtual memory between process instances is mostly shared. Therefore, additional RAM usage is negligible. From a RAM use perspective, there is no big difference between forking a process and spawning a new thread.

How does memory/RAM get shared between processes? Well, that's a different subject, but its really simple - its all in the virtual to physical mapping. Physical memory is the actual RAM, where-as virtual memory is an abstraction of that RAM that can exist in RAM, on disk (i.e. a page file), or anywhere else.

As a sharing example, a page of memory may exist at location X in physical RAM. Well, if two processes reference that same physical page of memory, they both can have different virtual pointers to it. If one process writes to that shared memory, Windows will apply a principle known as copy-on-write. This is where the process that wrote to the memory gets its very own copy of the shared page, because its now uniquely modified for that process. Read more on virtual memory if you want to know more.. back to Google Chrome.

Forking is very common for *nix environments, where applications fork themselves all the time. Windows applications traditionally spawn new threads instead of forking the entire process. Google decided to take a different approach, using forks. Note that the technical aspects of the Chrome fork may differ from a traditional *nix fork, but its conceptually the same.

The biggest advantage of isolating each tab into its own process space is that a crash in any one tab can't (or shouldn't) bring down the entire application (all the tabs). Again, since identical virtual memory is shared between processes, there isn't much extra memory overhead associated with all these Chrome processes. Each process will only allocate memory exclusively applicable to the tab it owns. Further, since the Windows CPU scheduler only sees threads, this forking design doesn't affect how Chrome performs during periods of high CPU contention.

One interesting performance note is that Chrome dynamically lowers the priority class of processes hosting background tabs, similar to what Process Lasso's ProBalance does. So, when you switch tabs, Google Chrome lowers the priority class of the old tab's process and raises the priority class of the new tab's process (to below normal and normal, respectively). I would hope that traditional single-process browsers do the same with individual thread priorities, but I wouldn't bet on it.

This lets the Windows CPU scheduler know which process's threads are most important during periods where there is heavy contention for CPU time slices. Of course, the most important threads will be those in the process thats holding the tab you're currently using. The others are important as well, but don't need quite the same level of real-time responsiveness as the foreground process's threads will. Although Windows has built in mechanisms to boost foreground thread performance, giving the Windows CPU scheduler 'hints' as to what should take precedence is always a good idea - after all, its not psychic.

That's what Process Lasso aims to do -- help give the Windows CPU scheduler a few more hints as to what should get precedence, and to rescue the user in the case of catastrophic CPU monopolization (as demonstrated by our CPU Eater demo). If more applications cared as much about their impact on the rest of the system as Chrome does, then perhaps there wouldn't be as much of a need for Process Lasso's ProBalance.

Well, I've spent enough time rambling on.. back to real work. I hope this helps explain to anyone who is concerned by the 20 different instances of chrome.exe they may see running on their PC ;).
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • WARNING: Cracks for Process Lasso may modify HOSTS file
    WARNING:  Cracks for Process Lasso have been seen to modify your system HOSTS file so that you can no longer access  bitsum.com  and/or  bit...
  • Process Lasso v3.65.3 beta released
    I've released the first new beta that is 100% UNICODE. I've regression tested almost all the software, though there may still be som...
  • Process Lasso v5.0.0.28
    This build continues maintenance, fixing several items and also making a nice improvement to the graph's display. Further, the last sele...
  • v5.0.0.18: Fix auto updater in XP
    During testing a few hours ago I noticed the auto-update was failing in some XP installations. Specifically, it would appear to stall at the...
  • BETA: Vista startup configuration
    Ok, I've got this fully correct now I think. In some cases in previous builds you could end up with both registry and Task Scheduler sta...
  • Process Lasso v5.0.0.48
    Changes: [.48]Change.GUI: Do not show 'Activate Now' menu item after activation [.48]Change.GUI: Adjusted logging thread CPU and I/O...
  • v5.0.0.17 final - Minor fixes
    This build fixes a reported issue with the watchdog rules (re: not default affinities, priorities, power schemes, but rather the terminate/r...
  • v5.0.0.21: Fix failure of web links within Process Lasso on some systems
    I've had reports of sporadic failure of the web links within Process Lasso. I've analyzed this situation for a while today and found...
  • One bit of bad news, one bit of good news
    One disappointing thing is that I've decided to cancel the change history shown in the update dialog, at least for v4.1. I may add it in...
  • Oh the frustration with this corporate crapware!!
    I now get uninstall feedback, as I solicit it (for better or worse). Once read, I can never go back, lol. Fortunately, most of it is actuall...

Blog Archive

  • ►  2013 (1)
    • ►  March (1)
  • ►  2012 (6)
    • ►  September (1)
    • ►  July (1)
    • ►  June (2)
    • ►  January (2)
  • ►  2011 (166)
    • ►  December (3)
    • ►  November (2)
    • ►  October (2)
    • ►  September (6)
    • ►  August (12)
    • ►  July (14)
    • ►  June (17)
    • ►  May (19)
    • ►  April (13)
    • ►  March (27)
    • ►  February (31)
    • ►  January (20)
  • ►  2010 (203)
    • ►  December (23)
    • ►  November (34)
    • ►  October (38)
    • ►  September (17)
    • ►  August (19)
    • ►  July (19)
    • ►  June (11)
    • ►  May (16)
    • ►  April (8)
    • ►  March (6)
    • ►  February (6)
    • ►  January (6)
  • ▼  2009 (43)
    • ▼  December (6)
      • CNET 'Reviews' Process Lasso
      • The hazards of reading user reviews
      • Running Process Lasso with Highest Rights - new be...
      • WARNING: Beware of pirated copies of Process Lasso...
      • New low cost license experiment
      • The many instances of Chrome
    • ►  November (1)
    • ►  October (10)
    • ►  September (3)
    • ►  August (1)
    • ►  July (9)
    • ►  June (2)
    • ►  May (3)
    • ►  April (4)
    • ►  March (4)
Powered by Blogger.

About Me

Unknown
View my complete profile