Showing posts with label CPU. Show all posts
Showing posts with label CPU. Show all posts

Wednesday, May 30, 2012

Firefox Performance Problems

Lately I've noticed Firefox seems to be lagging as of the latest release of version 12. 

Since my earlier post regarding setting Firefox up to utilize CPU affinity in Windows, things have been manageable, but lately a familiar flavor of failure seems to have crept back into this latest release.

If I leave Firefox open and running overnight with my usual group of a dozen or so tabs open, as soon as I resume activity in the morning, I notice in Task Manager that Firefox has one of my system's CPU cores at 100% usage, and has well over 1.7 GB of system memory in use, far more than what typically ranges from 400 to 700 MB on an average day.

Any given morning, thanks to Firefox.

More often than not, once I clear this CPU usage spike by ending the firefox.exe process, when I reopen Firefox I'm greeted with tabs notifying me of add-on updates that have been applied. 

This same issue seemed to be absent as of, say, version 10, but appears to have recently reemerged, at least in my experience on several different PCs running Windows 7.

A common thread among established users on the Firefox support forum points to the various add-ons users have installed. Clearly, many of them say, this is the culprit, and the often the user is advised to open Firefox sans add-ons and attempt to reproduce the problem by enabling add-ons one by one and testing after each to determine which might be the culprit.

I have no desire to invest the time and effort in something that I think developers and analysts at Mozilla should be hammering out themselves. It seems that if you release a platform on which users will develop add-ons, there should be safeguards in place to prevent poor coding from disrupting the integrity of the browser's functionality.

That being said, if you have a 64-bit system, consider trying out Waterfox, a Firefox build which emphasizes performance and speed, and mitigates a lot of whatever lurks in Firefox's codebase that might be causing this excessive memory usage and lag.

Perhaps it's some insidious conspiracy to make it so that when your computer is otherwise asleep at night, Firefox will rear its head and ramp up CPU usage and therefore power consumption, making an impact, however small, on world oil prices, driving up costs and compelling people to bite the bullet and get off the grid with their own solar, wind, nuclear, or other alternative power source.

I've had crazier ideas!

Tuesday, March 22, 2011

Process Lasso

I recently installed Process Lasso, a process management and optimization utility. 

Thus far it seems to be a highly effective and versatile tool for managing CPU. Using a proprietary algorithm dubbed ProBalance™, It strives to maximize your computer's responsiveness in spite of the demands placed upon the CPU by myriad running processes. Runaway processes that might ordinarily eat 99% or more CPU can be dynamically adjusted by Process Lasso so that lag is minimized.

Particularly useful is the ability to tag running processes in the GUI and assign them properties in the context menu, including process priority (to determine how valuable a process is and how much time the CPU devotes to it),  processor affinity (assigning the use of one or more CPU cores in a multi-core processor to a given process), gaming mode (favors a process when it's running so that the CPU dedicated to its function is maximized), and terminate always (very handy if malware with a specific filename keeps trying to execute and hang out in memory), as well as lots of other options that extend Windows' built-in Task Manager by leaps and bounds.

One example of Process Lasso's usefulness arose when I noticed today that a particular process was very frequently being restrained by Process Lasso for trying to monopolize CPU. According to this note about the graph portion of the GUI, bars in red denote CPU spikes, and if you hover over these, the process name is displayed (in this case, a process called smc.exe, or Symantec Mangement Client, part of Symantec Antivirus).

This particular process had, in the few weeks I've had Process Lasso installed, been restrained over 900 times, and each of the red vertical bars above denoting CPU spikes revealed smc.exe as the culprit.

I decided to right-click on the smc.exe entry from the list and modify its Default Priority Class from its previous Below Normal setting to Idle. At this point I'm unclear about whether I may be compromising Process Lasso's ability to do its job by dictating to it how to treat a particular process on my system; much of the documentation recommends allowing the ProBalance algorithm to do it's thing. 

However, given that I've already configured Symantec Antivirus to exclude from scanning the applications and folders which I most commonly use, I'm hoping that this step will restrict it from eating more CPU than it should; the graph after the change, at least, seems to indicate that Process Lasso is not having to restrain smc.exe nearly as much as before.

In general, seeing red can incite violence in human beings as well as bulls, so at least for my purposes, as far as Process Lasso is concerned, less red is a favorable outcome.

Thursday, January 27, 2011

Improve Firefox Performance with Processor Affinity

Firefox seems to frequently stutter or lag while doing seemingly trivial tasks like scrolling or even typing following the most recent Firefox 3 update.
Enter the concept of processor affinity, which enables you to direct applications to utilize one or more specific CPU cores in your multicore system. I discovered a blog post where the author describes creating a shortcut in Windows Vista or Windows 7 which will execute a given application with a specific processor affinity configuration.


  1. Copy and paste to create a copy of your current shortcut to Firefox on the Desktop.
  1. Pick a single CPU core, in decimal, to dedicate to Firefox, according to the chart below. I chose CPU 3 on my quad-core system.
0001 = 1 (CPU 0)
0010 = 2 (CPU 1)
0100 = 4 (CPU 2)
1000 = 8 (CPU 3)

  1. In the Target box, copy and paste one of the following lines (the first for 32-bit Windows, the second for 64-bit), and change x to match the value you chose in the above step (change the paths as necessary if your Firefox lives in a different location).
C:\Windows\System32\cmd.exe /c start "C:\Program Files\Mozilla Firefox\" /affinity x firefox.exe

C:\Windows\System32\cmd.exe /c start "C:\Program Files (x86)\Mozilla Firefox\" /affinity x firefox.exe

  1. Click OK to accept the changes, then close and reopen Firefox using the modified shortcut.

Windows XP also allows for changing the processor affinity setting for a given process via the Processes tab in Task Manager, but this setting is applied only for that instance of the application, so you can't use the above method to have a shortcut which automatically sets the affinity every time. If you try it, you'll get this error message:

Invalid switch - "/affinity"

Fortunately, a freeware utility called RunFirst exists which will perform in a similar manner, except it will by default assign only the first CPU core in the system to have affinity with the application you're running it with. To use it, create a batch file to execute firefox.exe like this:
      RunFirst.EXE "C:\Program Files\Mozilla Firefox\firefox.exe"

Now, Firefox has its very own CPU core to use on my Windows 7 system, which is advantageous in that the other applications running on my system need only contend with one core being potentially monopolized by some CPU-expensive operations which Firefox initiates.

I tend to browse with many (read: dozens) of tabs open simultaneously, as well as a plethora of add-ons installed such as AdBlock Plus, DownThemAll, FireBug, GreaseMonkey, FoxyTunes, Stylish, FiddlerSwitch, and more. Mine is hardly a “vanilla” setup, and given that these various add-ons let alone Firefox itself are developed by a variety of developers with a variety of coding styles, even bugs, it’s entirely likely that I’m a victim of chaos, that an unfortunate confluence of events are conspiring to kick my browsing experience in the teeth. 

At least this way, I'm letting Firefox do it's thing on just a single core, rather than having it bleed over onto the others and potentially making my other running processes unhappy.

So far, Firefox seems to be significantly more responsive than before!