Closed Bug 792147 Opened 12 years ago Closed 12 years ago

[ARMv6] Disable in-memory file cache

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 18

People

(Reporter: kats, Assigned: gbrown)

References

Details

(Whiteboard: [ARMv6])

Attachments

(1 file)

From about:cache it looks like the memory cache device is already disabled (I see no entries for it) but we should verify that it is disabled in the code.
It looks like it is enabled: https://hg.mozilla.org/mozilla-central/file/e4757379b99a/mobile/android/app/mobile.js#l53 It would only be used when the disk cache cannot be used...that's probably why you didn't see it in about:cache.
Does the memory get allocated whether we use disk cache or not? If it does, let's disable the in-memory cache for all builds, not just armv6.
Hmm, Geoff's comment makes me think the memory is not allocated if disk cache is used.
(In reply to Mark Finkle (:mfinkle) from comment #2) > Does the memory get allocated whether we use disk cache or not? If it does, > let's disable the in-memory cache for all builds, not just armv6. I looked into this once before, but can't remember right now...I'll look into it.
Assignee: nobody → gbrown
(In reply to Geoff Brown [:gbrown] from comment #1) > It looks like it is enabled: > > https://hg.mozilla.org/mozilla-central/file/e4757379b99a/mobile/android/app/ > mobile.js#l53 > That's interesting... the prefs on that page include: pref("browser.cache.disk.capacity", 20480); // kilobytes but on about:cache I see (for disk cache device): Maximum storage size: 204800 KiB That's off by a factor of 10. To test it I just loaded a bunch of websites and now my about:cache (disk cache device) says: Storage in use: 24235 KiB which is definitely higher than the 20480 we're supposed to limiting it to. Also I checked the data directory of my fennec install: shell@android:/data/data/org.mozilla.fennec_kats/files/mozilla/gm57a4v0.defaul/Cache # du -sh . 24.5M . So it does appear to be using more than the 20-meg limit. (Also I do now see files in the memory cache device as well, and the maximum storage size there is 1024 KiB which agrees with the prefs linked to above.)
That's because "smart sizing" is enabled for the disk cache -- if there's lots of space available, a larger cache size is used.
(In reply to Mark Finkle (:mfinkle) from comment #2) > Does the memory get allocated whether we use disk cache or not? If it does, > let's disable the in-memory cache for all builds, not just armv6. Memory used by the memory cache is generally (there is of course some minor fixed overhead) dynamic and proportional to the storage required by the memory cache entries. If there are no entries in the memory cache, very little memory is used; if the memory cache is configured for 1 MB, approximately 1 MB of memory is used. (I reviewed the code, reviewed my notes at https://wiki.mozilla.org/Necko/MemoryCache, and experimented with different disk/memory cache capacities, checking memory use with about:memory -- it all appears to be consistent.) With the disk cache enabled, very few entries are written to the memory cache. For example, I loaded 5 complex pages which wrote more than 10 MB to the disk cache; only 12 KB was written to the memory cache. With current settings, disabling the memory cache will reduce our memory use by at most 1 MB (approximately), and I think typically, less than 100 KB. I suggest disabling for ARMv6 only, and not expecting substantial gains.
I have some misgivings about disabling the memory cache given that the reduction in memory use is so minimal; on the other hand, the performance improvement from using the memory cache is also likely minimal. In the end, my thinking is that we may as well use the memory cache when there's is memory to spare, and not use it when we suspect memory is at a premium. This sets the browser.cache.memory.enable pref to false if MOZ_PKG_SPECIAL is defined; other memory-sensitive prefs already use this technique.
Attachment #663114 - Flags: review?(bugmail.mozilla)
Comment on attachment 663114 [details] [diff] [review] set memory cache pref based on MOZ_PKG_SPECIAL Review of attachment 663114 [details] [diff] [review]: ----------------------------------------------------------------- r=me, but please hold off on landing this until I have bug 792165 resolved. Hopefully I'll have some sort of benchmark in place by tomorrow.
Attachment #663114 - Flags: review?(bugmail.mozilla) → review+
Feel free to land this now, I have a stable enough benchmark running locally and gathering data.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 18
Whiteboard: [ARMv6]
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: