Closed Bug 942609 (fatfennec) Opened 8 years ago Closed 4 months ago

[meta] Reduce Fennec's storage impact: APK and data


(Firefox for Android Graveyard :: General, defect)

Not set


(Not tracked)



(Reporter: jwatt, Unassigned)


(Depends on 6 open bugs, )


(Keywords: memory-leak, meta, perf)

I just discovered that on one of my friends phones Firefox Mobile has leaked 800 MB of Storage space:

There are at least three separate issues there that I'm going to file bugs on and mark them as blocking this one.
Depends on: 942611
Depends on: 942612
Depends on: 942614
Summary: Stop Firefox Mobile from using so much Storage that app security updates are blocked → Meta: Issues caused by Firefox Mobile using too much Storage space
Depends on: 933979

Cleaning up temp files is hard and bound to fail on edge cases like 
crash etc.. (Compare Thunderbird). OTOH, you don't want to ever leave 
such files behind. So you need more drastic solutions than "cleanup 
after use". 


  * Avoid them altogether 
  * Make a subdir, and ensure that all temp files, no matter which kind, 
    are always placed there. This whole subdir will be deleted on close 
    (not startup).
Depends on: 857888
Keywords: meta
OS: All → Android
Summary: Meta: Issues caused by Firefox Mobile using too much Storage space → [meta] Issues caused by Firefox for Android using too much Storage space
>This whole subdir will be deleted on close (not startup).

There is no such thing as doing things on close in Android, and even for desktop this is something we're trying to get rid of (bug 662444).
Would it be possible to have the code make two temp directories - one for this session, another for the next - and each session flip from using one to the other? That way the contents of the not-in-use directory could be deleted without fear of deleting something that's in-use, and presumably be done at a point in time where its less likely to be bad/impossible, such as startup or shutdown. (Earlier would probably be better to try and clear Storage before any "no storage space" causing crashes prevent us from getting the chance to, if that's a concern.)

We wouldn't even necessarily need to rely on storing any information about which directory should be used next session if we're worried about crashes stopping us from doing that and clearing up. We could simply choose one of the two at random, and then it won't be too many restarts before any cruft is cleared up (well, for most users, statistically speaking).
Depends on: 947745
Depends on: 726051
Depends on: 951253
Depends on: 951262
Depends on: 959203
Alias: fatfennec
Depends on: 959833
Depends on: 961209
Depends on: 966707
Depends on: 915838
Depends on: 968229
I've also encountered the bug when doing this, on my Motorola Defy+ (Android 2.3.6) / Firefox Mobile 27 (and earlier releases) :

- uploading a large file (video) to a website
- selecting the file to upload from the android source selector, choosing a source (stock Android cam or gallery app)
- file will be fully copied into Firefox's data directory in /data/data/org.mozilla.firefox/ (file prefixed by tmp_)

So that when uploading a few big files or many smaller files, my Android's internal space is full.

Why does Firefox mobile need to copy the source file in its data directory, when it can access it directly from the source directory (/mnt/sdcard/dcim/... in the case of pictures and videos)?
Thanks for the report. We have a patch in-place to hopefully fix that issue over in bug 942611.
Depends on: 71895
Depends on: 926234
Depends on: 1001797
Depends on: 1015236
Depends on: splitapk
Depends on: 1039898
Depends on: 1039902
Depends on: 1041836
Depends on: 1001713
Depends on: 1041852
Depends on: 1041866
Depends on: 696095
Depends on: 748488
Duplicate of this bug: apkshrink
Depends on: 611781
Depends on: 1042354
Depends on: 856791
Depends on: 1042363
No longer depends on: 696095, 748488, 856791, 959203, 1001713, 1039902, 1042354
Summary: [meta] Issues caused by Firefox for Android using too much Storage space → [meta] Reduce Fennec's storage impact: APK and data
No longer depends on: splitapk, 1039898, 1041836, 1041852, 1041866
Depends on: 1042368
Depends on: 1042369
No longer depends on: 942612, 951253, 951262, 966707, 1015236
Depends on: 1042372
No longer depends on: 726051, 857888, 926234, 942614
Depends on: 1044079
Depends on: 1046396
Depends on: 1048683
Depends on: 1053016
Depends on: 1052837
Depends on: 1058852
Depends on: 1041882
Depends on: 1064363
Depends on: 1065712
Depends on: 1074340
No longer depends on: 1074340
Depends on: 1091087
Depends on: 1106935
Depends on: 1114998
Depends on: 1115000
Depends on: 1115004
Depends on: 1128675
Depends on: 1133158
Depends on: 1137380
No longer depends on: 1137380
Depends on: 945123
Depends on: 1148979
Depends on: 1148990
Depends on: 1149164
Depends on: 1149209
Depends on: 1062537
Depends on: 1150974
Depends on: 1153560
Depends on: 1155801
Depends on: 1171944
Depends on: 1171946
Depends on: 1172831
Depends on: 1173894
Depends on: 1174563
No longer depends on: 1174563
Depends on: 1174845
Depends on: 1175375
Depends on: 1175377
Depends on: 1175378
Depends on: 1175379
Depends on: 1158303
Depends on: 1177192
Depends on: 857730
Depends on: 1193431
Depends on: 1197874
Depends on: 1048191
Depends on: 1217675
Depends on: 1220892
Depends on: 1223526
No longer depends on: 1223526
Depends on: 1183320
Depends on: 1227795
Depends on: 1233728
Depends on: 1234009
Depends on: 590127
Depends on: 1237165
Depends on: 1237342
Depends on: 1235869
Depends on: 1242998
Depends on: 1253339
Depends on: 1263197
Depends on: 1263338
Depends on: 1242589
Depends on: 1268456
Depends on: 1272693
Depends on: 1282008
Depends on: 1284283
Depends on: 1291913
Depends on: 1294736
Depends on: 1296642
Depends on: 1297480
Depends on: 1301317
Depends on: 1314328
Depends on: 1277277
Depends on: 1330594
Depends on: 1346686
Depends on: 1218876
Depends on: 1380008
Depends on: 1391715
Depends on: 1398657
Depends on: 1430411
No longer depends on: 1430411
In case this adds to the discussion: In my case fully 250MB is taken up by the /storage/default folder.
There are a number of "http+++*" and "https+++*" folders (IndexedDB?) which are not deleted when clearing "cache" and "offline web site data" from Firefox.
I can also see c. 25MB of pending crash reports.
Relevant bug:
One more issue: my "app_tmpdir" increased to 1.8GB and my phone run out of storage.

The only way to resolve this is to go in the folder and delete those files, but you have to be rooted for that which won't work for all users.
Depends on: 1532446
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly]( an issue can be reported at the [Fenix GitHub project]( If you want to discuss your report please use [Mozilla's chat]( server and join the [#fenix]( channel.
Closed: 4 months ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.