Last Comment Bug 886131 - /data/data/org.mozilla.firefox/files/mozilla/$profile.default/safebrowsing & safebrowsing-backup is 8MB, which is too large for Android
: /data/data/org.mozilla.firefox/files/mozilla/$profile.default/safebrowsing & ...
Status: RESOLVED INVALID
:
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: 21 Branch
: ARM Android
: -- normal (vote)
: ---
Assigned To: Gian-Carlo Pascutto [:gcp]
:
: Sebastian Kaspari (:sebastian)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-23 08:51 PDT by Stefan Lasiewski
Modified: 2016-07-29 14:33 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments

Description Stefan Lasiewski 2013-06-23 08:51:50 PDT
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release)
Build ID: 20130511120803

Steps to reproduce:

Mozilla wants to provide Firefox for ARMv6 phones, as discussed at link [1].

I am running Android 2.3.4 on an ARMv6 phone. I have moved Firefox to the SD card, but Firefox still uses about 20-30MB worth of space on my phone's internal storage. Like most ARMv6 phones there isn't much doesn't have much internal storage. Firefox on Android typically uses about 20-60MB of internal storage [2], which is quite large for an Android App. The other apps on my phone use about 1-15MB.

I noticed that the Safebrowsing database and the database backup file have grown to use about 8MB worth of space on my phone's internal storage, which is over half of the space used by Firefox. 8MB is very large for this database and is larger then most Android apps.

Can you provide a solution to reduce the file space usage for this database? Perhaps delete the backup file? Store the Safebrowsing database on the SD card?

# cd /data/data/org.mozilla.firefox
# du -cks * | sort -n
291     databases
7873    res
13017   files
# cd mozilla/*.default/
# du -cks * | sort -n
1032    indexedDB
1293    browser.db
1474    webappsstore.sqlite-wal
4073    safebrowsing-backup
4126    safebrowsing
16884   total


[1] https://blog.mozilla.org/futurereleases/2013/01/11/firefox-for-android-beta-adds-additional-armv6-support/
[2] https://support.mozilla.org/en-US/questions/947996?esab=a&s=&r=0&as=s
Comment 1 Brad Lassey [:blassey] (use needinfo?) 2013-06-27 10:18:45 PDT
gcp, what do you want to do here?
Comment 2 Gian-Carlo Pascutto [:gcp] 2013-06-27 10:32:04 PDT
The database is about 4M by design and can't be shrunk further. Storing it on the SD card is totally insecure.

The -backup dir only exists while an update is in progress, or if you crashed/killed the browser during an update. In the latter case it will be deleted on startup.

This looks like an invalid bug to me.
Comment 3 Stefan Lasiewski 2013-06-27 10:59:03 PDT
The 4MB -backup file does disappear eventually, but it reappears periodically reappear and remains on disk for periods of several days. This happens often enough that it causes noticeable space problems on my phone.
Comment 4 Gian-Carlo Pascutto [:gcp] 2013-06-27 11:41:19 PDT
>it reappears periodically reappear and remains on disk for periods of several days.

As already explained, it's expected that it re-appears during every database update. But it should disappear after, unless Firefox crashes or is killed by Android due to lack of RAM while the update is ongoing. In that case, it'll be removed on the next update (actually the backup will be restored over the safebrowsing dir).

So, what's a bit strange here is that while it's certainly possible to kill Firefox in the middle of an update, the updates only happen once shortly after startup, and then every 45 minutes and finish in under a minute, typically. So the odds of encountering this situation shouldn't be *that* good to begin with.

Does your Firefox crash a lot, or do you flip back and forward between Firefox and other apps continuously?

Is it possible you often have less than 4MB free, and the updates are continuously failing because the new DB can't be saved to disk?
Comment 5 Stefan Lasiewski 2013-06-27 12:59:44 PDT
Yes, Firefox does crash alot. Your explanation makes sense.

My observations suggest that Firefox becomes more unstable as the phone's internal storage becomes more full. The largest consumer of space on my phone is Firefox by a good 10-15MB, which is why I filed this bug.
Comment 6 Gian-Carlo Pascutto [:gcp] 2013-06-28 00:32:28 PDT
I don't think there is anything actionable here then besides fixing whatever problems are causing the crashes in the first place.

You can disable safebrowsing via about:config:
browser.safebrowsing.enabled
browser.safebrowsing.malware.enabled

This will free up 4M storage at the cost of not getting malware warnings.

Note You need to log in before you can comment on or make changes to this bug.