Page Faults and Context Switches: Chrome, Flash and Techcrunch are killing my system

Update: Beta News reported a similar performance drop when running chrome 3.0.193.1 on Windows 7 RC

I am a power user. When I surf, I have around 20-25 tabs open. I have many processes running simultaneously on my windows 7 RC.TaskManager When I code, I have a test Ubuntu installation running on VMware.  To do all these, I spent most of my earnings on a 17″, Core2duo 2.4Ghz, 4GB ram, NVidia 8600M GT Dell Inspiron Laptop 1720. I have been using Google Chrome since the day it was made available and i keep up with the latest builds of the same. I also love the fact that it was zipper than my earlier favorite(Firefox) in opening new tabs. But, the whole time Google Chrome has been stressing my laptop’s hardware.

To prove my point, take look at the screenshots from Process Explorer, a Task Manager replacement for Windows. The Laptop was restarted and the screenshots were taken after around 4-5 hours of casual browsing with around 25 tabs open. I also had a Hadoop installation running on a VMware Player. Simultaneously, I was also dabbling  around with some code in eclipse .

The following were my observations

  • The Browser Process of Chrome is doing over 10 Million Page Faults. The closest that comes to this process is the Microsoft AntiMalware service(Morro engine) at 2 Million. As you can see in screenshot 1(below), the whole top list is dominated by Chome processes.
  • The Flash process has over 70 Million Context Switches(see screenshot 2(below) which was taken 20 odd minutes after screenshot 1), @5000 Context Switches/sec which is quite appalling.  The nearest competitors are Interrupts, Chrome again, Google Talk (Another Windows Application from Google)
  • Lastly, Techcrunch.com, Mike Arrington’s “Bloat-ware” Blog , one tab of which is taking around 500MB of RAM taking the total RAM occupied by all  Chrome  processes at 1.05Gb (Note: Firefox was really good at this. I seldom get past 400-500 MB on that many number of tabs). Also funny thing is that,  if you compare Techcrunch to Gmail, the latter  just takes 64MB of ram(see Chrome’s Process Manager screenshot above)

Let me teach my readers a quick Computer Science 101. The following explanations are over simplified, so if you are not satisfied with the explanation, go read Wikipedia for a detailed discussion over the same.

Page Fault: When a processor tries to fetch some block of data from the memory, if doesn’t find the data in the memory it tries to get that data from the hard disk. Operating system manages the blocks of memory and moves some of them to the HDD based on Most Recently used criterion. Since you know the over head of a disk access is way larger than a memory access, too many page faults translate to more spinning of the hard disk. Read Wikipedia for a detailed description

Context Switch: In a multiprocess environment like windows. The cost of switching from one process to another process is quite high. If an application keeps switching very fast, that means it’s not getting enough cpu time to do its work, and it is wreaking havoc on the other applications by decreasing their effective cpu time also. Read Wikipedia for a detailed description

Few things come out of this little insight

  • Flash NPAPI plugin is a useless piece of crap. Even after 10 major versions, they still have an ill designed system. (Some people have told me this was specific to chrome as according to them Flash runs fine on Firefox)
  • Chrome even though is very fast in terms of HTML rendering and JavaScript execution. But, it kills the system by the large number of PageFaults and Context Switches it does.
  • Techcrunch seems to be doing more job than a complex web-application like Gmail. Or is it because the 20 odd flash ads they have on their Blog. They could be even doing mouse pointer/user tracking or even Javascript  code Instrumentation. Who knows!(Just Kidding). What ever it is, they need to find and fix the root cause of the problem.

If my readers believe they are also suffering from the same fate as I am, I would request them to put their stats up in the comments section.

I am using Chrome 3.0.193.0 with Flash 10.0 on a Win7 RC ( Yeah I know that it’s a unstable combination. But, even when I was using Chrome 2.0 on Vista SP1 with Flash 9, I had the same problem)

Process ExplorerProcess Explorer2

About these ads

11 responses to this post.

  1. interesting article

    Reply

  2. Its a conspiracy by Robin to defame Google and Chrome !!!! :)

    Reply

    • Yeah right.. Like I have just that in life. Go check your Task Manager and come out with Numbers

      Reply

      • On a serious note, even I have noticed Chrome eating much of the available memory. Luckily for me my 1 GB ram suffices as i do not use more than 15-20 tabs concurrently and mostly work remotely using putty.

        Let me know if you find a plug for this.

        Cheers !

  3. Yeah, I had the same problem when I installed chrome, although I didn’t bother to go so deep into my investigation. Each tab was taking around 100+MB of space and on my 1GB machine I ran out of memory _very_ soon.

    Reply

  4. This was the first thing i told Robin after he adapted chrome about 1 yr back.. its just about time he took notice of it :). Even when it was in its nascent state it consumed 40 mb for one gmail tab +10-20 mb for other housekeeping.

    Reply

  5. Windows 7 eeeeeeeeeeeh! , probably OS aint smart enuf
    what would chrome developer , tell you , “PATCHES WELCOME”

    i use ff 3.5 \m/

    Reply

  6. Posted by levinas69 on October 1, 2009 at 11:59 pm

    Thanks for this article. I recently converted to Chrome on Vista. Same issue. At first I thought that it was a virus or trojan that had slipped into my system. But, after using process explorer, I reached the same conclusion as this article. Out of control page faults from Chrome. This is un-Google. I hope it gets fixed.

    Reply

  7. I absolutely agree. We trade Firefox’s multi-thread bloat for multi-process bloat. However, Chrome’s bloat is from not having shared memory, i.e. some memory must be duplicated for each process. Each process is definitely faster and it will be even more so as we get more cores. I have the 720 i7 (4 core, 8 HW threads).

    BTW, the reason I came here was to look into why Win 7 is so bad with context switching or page swapping. When chrome, netbeans, vmware and others have exhausted 2.8 GB of 4 GB of RAM, Win 7 has a 3 sec delay (pf and swap) each time I switch between programs. Chrome is using about 600 MB. VMWare :250 MB. Netbeans 500 MB. The rest is mostly Win7. This is very frustrating considering that my XP machine was slower and had half the ram AND I used it the same. It should not be necessary to turn off paging.

    There is an evil trend where the amount of memory available is proportional or similar to the amount used. I promise you that in 10 years, when RAM holds 32 to 64 GB for a typical PC, RAM will still be a problem because dumb IT programmers who could not get a real CS or CpE degree (that’s me), just waste RAM, thinking that it’s free. They work at MS and Google, and they will always be around.

    Reply

  8. It’s not just Chrome, but Firefox and IE also. In my case McAfee goes crazy when these apps start and takes up 50% of the CPU checking them out. So a virus scan could also be a issue here too.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: