Question

posted by stefanlasiewski
2 years ago
Why is Firefox on Android so large? It uses 20-60MB and fills up the volume? (App: 24MB. Data: 30MB+)

Summary:

Firefox is using too much space on my Android phone and this is causing problems on my phone such as "Low on space" errors. Android applications are unable to receive security updates due to Firefox's high space utilization, which is a security problem.

Why does Firefox use so much space and how can I prevent or resolve this problem?

Firefox is using a huge amount of space. It is the largest application on my phone by a long shot. It seems that Firefox will grow without bounds until it triggers a "Low on space" warning on the Android device. When this "Low on space" warning is reached, Firefox becomes unstable, and I am unable to install other Android applications. Often applications are unable to update themselves due to Firefox's high space utilization, and cannot receive security updates which is a security problem.

Please see the following screenshot which shows that Firefox is using about 30MB worth of space, and is about twice as large as the next largest App, Google Maps.

When I install Firefox and move it to the SD card, the app only uses a few Megabytes worth of space (See the screenshot above to show the space, according to Android). Firefox functions fine. But eventually Firefox grows to be much larger.

I have a more detailed analysis of the problem. I believe this is a bug in Firefox, and I will file a bug report later. Look below for my temporary workaround.

Firefox has a feature known as a "Smart cache". I cannot find much information about this cache, but the name suggests that the size of the "Smart cache" is determined automatically.

To see the value of your cache, browse to "about:cache" and note the values. For me, "Maximum storage size" is currently 256000 KiB (Yes -- 200MiB). This value is equal to the value of browser.cache.disk.capacity, which was modified by Firefox from it's default value of 20480.

I was regularly Firefox's Clear Data and Cache from the Application manager.
Since Link2SD won't move the data files to sdcard, I had to do it manually.
but first the device must be rooted and busybox is installed on the device.

now I moved the files and cache directory from /data/data/org.mozilla.firefox to my sdcard's second partition. The /data/data/org.mozilla.firefox directory now has less than 2 MB, and it is stable in that size

This is a great tip, and I've been looking for something like that for some time.

I would only add that you could also specify where to store the cache files using the browser.cache.disk.parent_directory property, for example, to use external storage.

Please, note that this property is not there for a good reason (you'll have to add it manually).
Putting your Cache data in a removable device is not a good idea, as it can easily been extracted, and copied elsewhere, compromising your privacy and security.
But if you keep your smartphone with you all the time, then you can assume the risk of trading for a small amount of valuable internal storage space.

Thanks for pointing out the option for `browser.cache.disk.parent_directory`. I understand the privacy implications of storing the cache outside the profile directory, but I don't have much choice. Firefox as an App grew quite a bit with the latest release (8MB worth of fonts) and my phone was so full that the system wasn't applying security updates to other Apps. I either need to get this disk space problem resolved or I will have to stop using Firefox.

I did this to free up space:

Created a new directory on my sdcard (`/mnt/sdcard/something/`)

Under `about:config` set browser.cache.disk.parent_directory to match the new directory created above.

Restart Firefox (I had to kill the Firefox app)

Went to a few cache-heavy websites like Facebook and Pinterest

Verified that the cache was working under `about:cache`

Deleted the old cache files under my foo.profile/Cache directory

Went to `about:config` and reverted a few of my manual settings which I set months ago to conserve disk space.

Now Firefox uses 10MB less space on my system memory then it did before. I can also make the cache larger (much larger) which will speed up the viewing of webpages.

I could not create a symlink from my old Cache directory to the new Cache directory.

I found that the Safebrowsing database uses between 4-8MB of space. See bug https://bugzilla.mozilla.org/show_bug.cgi?id=886131 . If Firefox crashes often, then Safebrowsing might use 8MB until it refreshes the database. A user can disable the safebrowsing feature via about:config and then delete the safebrowsing files (requires root) to save another 4-8MB of space.

This is a great tip, and I've been looking for something like that for some time.

I would only add that you could also specify where to store the cache files using the browser.cache.disk.parent_directory property, for example, to use external storage.

Please, note that this property is not there for a good reason (you'll have to add it manually). Putting your Cache data in a removable device is not a good idea, as it can easily been extracted, and copied elsewhere, compromising your privacy and security. But if you keep your smartphone with you all the time, then you can assume the risk of trading for a small amount of valuable internal storage space.
'Get Android Phone Android Phone'

So, I don't get it. If I go to the App info page for Firefox on my Android (HTC EVO 3D), it has a button: "Move to phone", which implies that FF is installed on my SD card, but the stats say:

Total: 123MB

App: 2.45MB

USB storage app: 25.44MB

Data: 94.86MB

SD card 0.00B

Cache: 0.00B

If FF is installed on the SD card, why does this say it takes up 0.00B? (Not even a fraction of a byte!)

What is the 94.86MB of Data? I don't want to (and am not sure how to) delete it blindly.

What is the USB storage app of 25.44MB?

My Internal memory have only 150MB left out of 2GB. Firefox is the biggest app, by far. This is too little space to (1) install new apps, and (2) update many existing apps! I have a 64GB SD card with 32GB free! Surely some/most/all of FF could live on the SD card, where there is over 200 times as much space available! What makes the internal memory more secure?

@Chelmite, I think the way Android reports usage is a bit confusing. I think that "USB storage app" is the space the Firefox "Application" takes on the SD card. "App" is the space it still takes from the internal storage after it's been moved to SD (if you move it back to Phone, you'll notice it grows again to nearly 30MB).

Data is actually everything that Firefox uses or creates for your user profile, settings, and even cookies and cached pages which by default are not stored on SD card (even if the App itself has been moved to it) because of a simple security reason:
If someone takes your device, they may easily remove the SD card and access sensitive data such as cookies or cached pages without even having to unlock your phone!

Firefox Cache doesn't use the Android convention for storing the cached info in an accessible way that is easily cleaned up from Android's UI. Instead you'll need to clear Firefox cache from its in-app Settings / Clear Private Data option. That's also why all cached web pages sum up into the Data field instead of the Cache field.

If you've read all this thread, early on we talked about a possibility of compromising your privacy and security, and possibly performance, in favor of a few megabytes of internal storage by having Firefox to store its cache on the SD card. I do not recommend this unless you are an advanced user, and you really understand the risks.

As a Firefox user on everything but my phone... including desktop Windows, Linux, and Nexus 7 tablet... I really think there should be an easier way to get these solutions working on my cheap phone. Like others, my phone only has 250MB of internal storage, and I'm aware there's risks involved in storing data on SD, but otherwise FF is unusable.

I instead use Opera Mobile (now Opera Mobile Classic), which is great and only uses about 4.5MB total if app is moved to SD without changing any settings. But I would prefer to use FF due to syncing.