Jump to content

Firefox disk/RAM trickery (can't find a software section)

MG2R
Go to solution Solved by MG2R,
I also tested that page till my FF was using ~3Gb of ram. Switched tab and usage dropped to around 600Mb switched back and RAM usage instantly went back to ~3Gb without any lag to the opened tab. For testing purpose at the same time I was monitoring disk I/O and I can say that FF doesn't write anything to disc to reduce RAM usage. My only explanation is that FF uses some internal data compression to reduce RAM usage.

Thanks! your post made me look a bit further into both taskmanager the firefox about:config file. The first thing I noticed is that whe you switch to an image heavy tab, not only the ram climbs before switching, but your CPU usage as well. This would indeed indicate some sort of calculation being done. Yet, when you switch back to a light tab, your CPU has less work, so I didn't think firefox was actually compressing data (would be waaaay slower than how it was happening now).

After going through everything having to do with chache, memory, disk and the likes, I stumbled upon a few settings to do with rendering of images. If you search for 'image.mem', you get a list with all the stuff related to memory usage by images. If you set image.mem.discardable to false, firefox will keep image renders in ram even if you are not looking at the tab. This fixed the problem.

So it turns out that firefox keeps all actual data in ram, but not the rendered pages, thus re-rendering every tab once you switch to it. Now that I have that turned of, my tab transitions are instant and firefox uses 2.4GB with 18 tabs+PTLLT. Without the PTLLLT tab I'm down to less than 400 MB :p In other words: nothing.

Happy now. Thanks again!

If there are any FF specialists around, please answer me this: I'm using firefox on my machine with 8GB RAM. It is set in about:config to use both memory and disk cache (unknown capacity for ram and 350 MB for disk). I encounter the following situation while browsing http://picturesthatlooklikethis.com/, a site with big pictures:

When I scroll down and load a huge amount of pictures, my RAM usage (obviously) goes up, right now up to 'bout 2.1GB. When I then select another tab, the memory usage goes down in the blink of an eye to about 900MB and 10 sec later to about 660MB. When I want to go back to my PTLLT-tab, it takes a while to switch. During this waiting time, I can see the RAM usage go back up to the previous 2.1GB.

That means that FF is loading about 1.5GB (2.1GB-0.6GB) from somewhere into the RAM. I figured it must be from some kind of cache file my system drive (the only drive in the system, a RAID0 of two 120GB SSDs), so I went looking for the file that contains the stuff firefox does not like to keep in ram. I don't have a paging file, so that can't be it. I fired up spacesniffer and went to the firfox cache file, which is around 350 MB (as defined in the config). So it can't come from there either. Next thought was Temp, but that folder is only 160MB, so not an option either.

Two questions remain:

  1. Where does FF store the data it doesn't want/need in RAM?
  2. How do I keep firefox from clearing stuff from opened tabs out of ram? I have ample, so I just want it to keep everything that's opened for quick tab switching and a nicer experience.

Link to comment
Share on other sites

Link to post
Share on other sites

FireFox is known for needing lots of ram. This was the reason that i now use chrome instead of firefox.

Link to comment
Share on other sites

Link to post
Share on other sites

FireFox is known for needing lots of ram. This was the reason that i now use chrome instead of firefox.

If you would've read the hole thing, you would've known that I don't mind the memory usage. On the contrary, I want firefox to use even more RAM (or at least, keep using the same amount as long as I don't change any tabs)

Link to comment
Share on other sites

Link to post
Share on other sites

FireFox is known for needing lots of ram. This was the reason that i now use chrome instead of firefox.

Say that to Nightly users.

FF19 is a whole lot more efficient RAM wise compared to Chrome. It might be an Alpha for now, but it sure does mean that they've fixed the memory leakage and it'll be up in the stable version in no time.

Link to comment
Share on other sites

Link to post
Share on other sites

It is your FireFox cache, here is a usefull link, but you have to have AMD RAMDisk software:

http://www.radeonmemory.com/files/QuickUseGuide_MovingBrowserCache_V1.pdf

"People assume that time is a strict progression of cause to effect. But actually from a non-linear, non-subjective viewpoint, it's more like a big ball of wibbly wobbly timey wimey stuff."

 

Dont understimate my skillsz, you might look foolish.

Link to comment
Share on other sites

Link to post
Share on other sites

  1. How do I keep firefox from clearing stuff from opened tabs out of ram? I have ample, so I just want it to keep everything that's opened for quick tab switching and a nicer experience.

Tools > Options > General > Under "Startup", un-tick "Don't load tabs until selected".

Firefox 13 and onwards introduced this as a memory saving feature by unloading in-active tabs from memory. It was mostly for start-up purposes but becomes annoying during extended browser use with many tabs.

As FF doesn't utilise the same cpu process per tab as chrome, it becomes invariably slower. :(

Intel 3960X @ 4.6GHz Corsair Dominator Platinum CMD64GX3M8A2133C9 64GB | ASUS Rampage IV Extreme | 2*ASUS PG279Q EVGA GeForce GTX Titan X | 2*Corsair Force GT 256GB in R0 [OS Drive] | Samsung 850 Pro 1TB [secondary Drive] Hitachi Deskstar 7K4000 Raid 6 [8*4TB — Media Array] | PAN-UJ-235A Blu-Ray Slot Load | PAN-UJ-875A DVD Slot Load | Corsair AX1200i | Corsair H100i | Lian-Li PC-V2120X | LSI 9271-8i w/ Intel RES2SV240 | Windows 7 Ultimate 64bit | Ducky Shine II [Cherry MX Brown / Blue LED]

Link to comment
Share on other sites

Link to post
Share on other sites

It is your FireFox cache' date=' here is a usefull link, but you have to have AMD RAMDisk software: [url']http://www.radeonmemory.com/files/QuickUseGuide_MovingBrowserCache_V1.pdf

Can't be the cache, that file is too small, as I've written in the original post. (see quote below)

I figured it must be from some kind of cache file my system drive (the only drive in the system' date=' a RAID0 of two 120GB SSDs), [...'] I fired up spacesniffer and went to the firfox cache file, which is around 350 MB (as defined in the config). So it can't come from there either.
Link to comment
Share on other sites

Link to post
Share on other sites

  1. How do I keep firefox from clearing stuff from opened tabs out of ram? I have ample, so I just want it to keep everything that's opened for quick tab switching and a nicer experience.

Tools > Options > General > Under "Startup", un-tick "Don't load tabs until selected". Firefox 13 and onwards introduced this as a memory saving feature by unloading in-active tabs from memory. It was mostly for start-up purposes but becomes annoying during extended browser use with many tabs. As FF doesn't utilise the same cpu process per tab as chrome, it becomes invariably slower. :(

Tried it, doesn't work. Also it wos under options>tabs instead of options>general. Firefox behaves exactly the same way :/

any other ideas?

Link to comment
Share on other sites

Link to post
Share on other sites

I also tested that page till my FF was using ~3Gb of ram. Switched tab and usage dropped to around 600Mb switched back and RAM usage instantly went back to ~3Gb without any lag to the opened tab. For testing purpose at the same time I was monitoring disk I/O and I can say that FF doesn't write anything to disc to reduce RAM usage. My only explanation is that FF uses some internal data compression to reduce RAM usage.

ff_ram_usage_zps79f097e5.png

Passionate indie android developer

Link to comment
Share on other sites

Link to post
Share on other sites

I also tested that page till my FF was using ~3Gb of ram. Switched tab and usage dropped to around 600Mb switched back and RAM usage instantly went back to ~3Gb without any lag to the opened tab. For testing purpose at the same time I was monitoring disk I/O and I can say that FF doesn't write anything to disc to reduce RAM usage. My only explanation is that FF uses some internal data compression to reduce RAM usage.

Thanks! your post made me look a bit further into both taskmanager the firefox about:config file. The first thing I noticed is that whe you switch to an image heavy tab, not only the ram climbs before switching, but your CPU usage as well. This would indeed indicate some sort of calculation being done. Yet, when you switch back to a light tab, your CPU has less work, so I didn't think firefox was actually compressing data (would be waaaay slower than how it was happening now).

After going through everything having to do with chache, memory, disk and the likes, I stumbled upon a few settings to do with rendering of images. If you search for 'image.mem', you get a list with all the stuff related to memory usage by images. If you set image.mem.discardable to false, firefox will keep image renders in ram even if you are not looking at the tab. This fixed the problem.

So it turns out that firefox keeps all actual data in ram, but not the rendered pages, thus re-rendering every tab once you switch to it. Now that I have that turned of, my tab transitions are instant and firefox uses 2.4GB with 18 tabs+PTLLT. Without the PTLLLT tab I'm down to less than 400 MB :p In other words: nothing.

Happy now. Thanks again!

Link to comment
Share on other sites

Link to post
Share on other sites

Glad that my test at least somehow helped fix the problem :)

P.S. With compression I wasn't thinking something like rar or zip type of compression solution that indeed would be slower. :D

Passionate indie android developer

Link to comment
Share on other sites

Link to post
Share on other sites

Glad that my test at least somehow helped fix the problem :) P.S. With compression I wasn't thinking something like rar or zip type of compression solution that indeed would be slower. :D

Yeah, but still, even with a superduper fast compressing algorythm running on my 3570k@4.5GHz, 2.1GB->600MB is awefully fast. I think it just wouldn't be feasable. Good suggestion though.

Link to comment
Share on other sites

Link to post
Share on other sites

Glad that my test at least somehow helped fix the problem :) P.S. With compression I wasn't thinking something like rar or zip type of compression solution that indeed would be slower. :D

Yeah, but still, even with a superduper fast compressing algorythm running on my 3570k@4.5GHz, 2.1GB->600MB is awefully fast. I think it just wouldn't be feasable. Good suggestion though.

typo (edit is not working): 2.1GB -> 600MB in 1 second
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×