By default, Firefox does not use a fixed size memory cache. It uses a percentage of memory and this means more memory on your system=more memory usage of Firefox. So, this could cause your browser to use more memory cache. But you can apply the settings below to have a fixed size of memory usage.
Follow these steps:
Type about:config in the address bar and hit Enter. Then in the appeared window click on the button which is labeled “I’ll be careful, I promise”.
Create a new Boolean value by right-clicking anywhere in the window and clicking New > Boolean, then in the pop-up box entering: browser.cache.memory.enable
Then check the Boolean value under the Value category. It should be “true.” If it is not, change it by double clicking on it.
Right click anywhere in the about:config window and select:
New > Integer
In the pop-up box enter: browser.cache.memory.capacity
Then you need a number to type into the “Enter integer value” pop-up window. The number depends on how much memory your computer has. Here I have provided a list and you can enter the number according to this list:
- 256MB of RAM or less: Enter 4096 as the value
- 512MB of RAM: Enter 8192 as the value
- 1GB of RAM: Enter 16384 as the value
- 2GB of RAM: Enter 32768 as the value
- 3GB of RAM: Enter 65536 as the value
- 4GB of RAM: Enter 131072 as the value
and so forth. Just double the number as the RAM doubles.
If you wish to restore the value to the default, just change the browser.cache.memory.capacity to -1 (negative one).
To reduce Firefox memory use upon minimization:
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.
When you minimize Firefox it releases RAM that is normally used for the cache.
Edit: Since I did this I no longer have problems with Firefox freezing, crashing, or using an increasing amount of memory as time goes by.