Apr
22
2009
Firefox Development: Managing Memory Use
Author: mprokesAlpha Edition!, e-mail spelling/grammer/topic suggestions to mattprokes@gmail.com

The Professional Developer Series
Volume 2, Web Development
Chapter TBD
Page: TBD
A bit more about firefox, while in many cases the browser is exclusivly the best way of getting web development done it does have its own set of issues; particularly in utilization of computer memory.

I have seen firefox memory utilization start off at a feeble 20,000k, and grow to well over 1.5gb at times. Now, just so you know not all of this is completely attributed to issues with firefox its’ self. Memory leaks in websites’ applications, and firefox having a multi-tab environment greatly contributes to browser memory utilization overhead.
Extensions, are another HUGE factor when talking about how much memory the browser will use. To give you an idea, lets assume that 3 website tabs are each consuming 15,000k (a total of 45,000k). Next lets open a firebug extension and say it consumed an extra 5,000k per tab. That would spike the total memory useage to 60,000k.
Finally, lets add in 5 other extensions that also consume 5,000k (thats an extra 75,000k), you can see how extensions start to greatly contribute to the memory overhead of firefox. Sadly if you factor in leaks, and other issues. Memory starts to add up rapidly, so what can we do about it?
Option 1: Disable Extensions When Not In Use
One solution would be to only enable the extensions when doing development. Start off by opening the add-ons window again (page 16), but this time click on the extensions button in the window (the thing that looks like a puzzle peice).
Simply click on the “Disable” button to disable the extension when you do not need to use it, firefox will prompt you to restart and after you do the extension will not be available to the browser again until you re-enable it. To re-enable the extension simply go to the same configuration area and click “Enable” for the plugins you wish to use.
While this method works perfectly, part of an annoyance is having to click through and enable/disable several extensions when all you really want is a light-weight version of firefox without those plugins. That is where option 2 comes in.
Option 2: Set Up A “Light Weight” Firefox Profile
The idea of setting up a light-weight firefox profile is nothing spectacular, but it will for-sure take care of extension memory issues all in one shot. So lets get started, first off I have found a neat little firefox extension to make the job more easy called “profile switcher”, https://nic-nac-project.org/~kaosmos/index-en.html#profname lets go out to the website and right-click on the “Download” link choosing “save link as”.

Save it to a location on your computer where ever that may be. Next lets install the extension, in firefox choose [File > Open File], and select the extension that was just saved to your computer.

The browser will popup the familiar extension install window (page 16), install the extension and re-start the browser. Once the browser is re-started, you should see a blue icon on the bottom of the browser saying “default”. This is the profile switcher.
What are profiles in firefox? You can think of profiles almost as a way of defining different versions of the same browser. Its actually intended for situations such as multi-user environments, example: lets say that bill, judy, and jane all are using the same computer. Bill wants to have his own set of bookmarks, judy also wants her own set, and jane doesn’t use bookmarks at all. Profiles would allow bill to create a profile named say “firefox-bill” within the browser which would save all his bookmarks to firefox-bill if he was using it.
We will be using profiles in a little different way, currently the profile is set to “default” and is pretty heavy with all these extensions, so lets simply create a “firefox-lite” profile which contains NO extensions! Lets start off by right clicking on default, and click on “Open Profile Manager”.

You will probably get a pop-up asking you “Close current profile when switching?”, choose “No”. Next the “Firefox Choose User Profile” window will pop-up. Click on the “Create Profile” button.

A window will pop-up describing what creating a profile does, click next. The next window that you will see will ask you for a profile name type “firefox-lite”, and click the finish button.

You should now see firefox-lite in the profile chooser, double click on it and a new version of firefox should start right up with no extensions installed! This functionality should allow you to create tailored custome firefox environments based on the type of development you are doing. Are you doing SEO? Great, install all the SEO extensions you want, and simply create a firefox-SEO profile, etc.











