Leveraging FireFox's Restore Session Feature To Control RAM Usage

Posted December 27, 2006 at 2:44 PM by Ben Nadel

Tags: Work

I am running FireFox 2.0.0.1 and it rocks, but the RAM usage of it tends to climb really high during the day. Not too long ago, I found out by accident that if your FireFox crashes and then you start it up again it will ask you if you would like to restore the previous session. How bad-ass is that? I know, I know. But what's really cool that just occurred to me is that you can use this feature to control the RAM that FireFox uses.

My FireFox process was just hovering at about 250 MEGs of RAM usage. That's a ton or RAM (I don't have a crazy amount on this computer). I also have a good number of windows and tabs open as well for development, email, ColdFusion news feeds, etc. Well, now instead of closing them all down, then re-opening them manually, I just go in, Kill the FireFox process (which kills all the windows at once) and then restart FireFox which will in-turn, restore the session that was just running.

Doing this, the FireFox RAM usage went from about 250 MEGs down to about 95 MEGs and I hardly had to push a few buttons. Now, granted, this is a total misuse of the feature and probably of Window's task manager, but when my machine starts to drag, it just has to be done.



Reader Comments

Dec 27, 2006 at 3:50 PM // reply »
6 Comments

You can accomplish the same thing without killing the process.

Under options, main, there is a "startup" dropdown, with an option to "open tabs and windows from last time".


Dec 27, 2006 at 4:01 PM // reply »
11,246 Comments

Doug,

Good option to know about (I was unaware that it could do that). However, I am not always looking to start up with previous tabs. I only want to do this when I cycle the ram. Or, does it prompt you for this on start-up?


Dec 27, 2006 at 11:00 PM // reply »
95 Comments

Ben, interesting workaround :-)

However, here is a better solution:

1. Open Firefox and go to the Address Bar. Type in about:config and then press Enter.
2. Right Click in the page and select New -> Boolean.
3. In the box that pops up enter config.trim_on_minimize. Press Enter.
4. Now select True and then press Enter.
5. Restart Firefox

I got this from here:
http://tech.cybernetnews.com/2006/03/26/this-may-help-your-firefox-memory-leak/


Dec 28, 2006 at 7:50 AM // reply »
11,246 Comments

Boyan,

Awesome link! I have just implemented the config changes. Let's see if they work. Thanks a lot!


Dec 28, 2006 at 8:08 AM // reply »
95 Comments

Ben,

you are welcome. I found it yesterday too so I thought I'd share. It works great.


Dec 28, 2006 at 8:11 AM // reply »
11,246 Comments

DUUUUUUDE! I just minimized my FireFox and the RAM dropped to 24 Megs :) that is a HUGE drop.

Rock on with your bad self!


Dec 28, 2006 at 9:42 AM // reply »
11,246 Comments

Hey, one caveat I just discovered for the minimize-RAM-flush thing above; it only seems to work if you manually minimize the windows. If I do a START+D (windows key and D key to show desktop) it doesn't seem to register this as a minimizing of the windows.


Dec 28, 2006 at 3:11 PM // reply »
120 Comments

Instead of killing the Firefox process, can't you simply File > Exit?


Dec 28, 2006 at 3:19 PM // reply »
11,246 Comments

Oooooh. I didn't realize that FILE > EXIT would close all the windows. Sweet-ass. That is much better. I can't believe I didn't know that.

Goes to show you how rarely I close my FireFox :)


Dec 28, 2006 at 3:28 PM // reply »
120 Comments

Well, I have to admit that I normally never close Firefox and only usually rely on the restore sessions feature after a system crash... :)


Mar 14, 2007 at 1:49 PM // reply »
1 Comments

Clever idea. For unrelated reasons I'd like to be able to save my session and quit (rather than automatically restart) Firefox.

Something like that would be useful when you have several websites open in two or more tabs (and/or separate windows) and would like to open them all back up at a later time.

Using your 'kill process' technique should allow me to do this, but it would be nicer if there was something equivalent to it that could be attached to a button or menu item inside of Firefox because it would require fewer steps.


May 22, 2007 at 3:52 AM // reply »
2 Comments

Be aware that you need to have "Warn me when closing multiple tabs" unchecked or it won't save the session when quitting FF.
If you want to use the above option, you must terminate the process.


May 22, 2007 at 4:02 AM // reply »
2 Comments

Also, just quitting doesn't always save all windows!


Pat
Jun 19, 2008 at 11:08 PM // reply »
1 Comments

Doing the close trick works really well. Personally I use it for reading fanfictions because I like to open ~ 10 stories at a time and don't normally get around to reading them all at one time.



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 24, 2013 at 11:21 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@WebManWalking, Ha ha, let's us never speak of justifying "##" notation again :P ... read »
May 24, 2013 at 11:18 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Ben, Ah, so it was indeed how I vaguely remembered it to be: A direct assignment value = users.id[ i ] causes value to retain the sticky datatype of the query column. Although unnecessary in ... read »
May 24, 2013 at 9:11 AM
Preventing Links In Standalone iPhone Applications From Opening In Mobile Safari
@Brandon, Hi, No, I haven't been able to do that. I have just kept it as it is. ... read »
May 23, 2013 at 9:52 PM
Preventing Links In Standalone iPhone Applications From Opening In Mobile Safari
@Muhmmadibn Did you figure out a solution to launching PDFs? I am running into the same issues myself. There is no way to close the PDF or go back once you launch it. Thanks in advance! ... read »
May 23, 2013 at 6:06 PM
The Girl Who Broke My Heart, And Made Me A Better Person
Good day,ladies and gentle men, my name is Dr AMADI the great spell caster in Africa, i have help so many people for different kind of problems,who say there is no solution to problems on earth, that ... read »
May 23, 2013 at 4:26 PM
ColdFusion QueryAppend( qOne, qTwo )
@Heather, Glad people are still getting value out of this! ... read »
May 23, 2013 at 3:49 PM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@WebManWalking, I meant the code at the bottom (not the video). I did try to experiment with an intermediary variable, like: value = users.id[ i ]; arrayContains( userIDs, value ); ... but t ... read »
May 23, 2013 at 11:06 AM
Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusion
@Ben, Are you talking about As Number: YES As String: YES As Java: YES? If so, that's with 3 different ways of referencing the constant 1, not users.id[1]. Query object references(*) are what seem ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools