Closed Bug 388649 Opened 18 years ago Closed 17 years ago

Site icon cache grows and grows. Is this thing ever purged?

Categories

(Camino Graveyard :: General, defect)

All
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.6

People

(Reporter: mark, Assigned: stuart.morgan+bugzilla)

Details

(Keywords: fixed1.8.1.10, Whiteboard: [camino-1.5.4])

Attachments

(1 file)

While troubleshooting the ridiculously high Tp numbers on maya, I found several gigabytes of junk floating around in ~/Library/Caches/Camino/IconCache. Almost all of the cached icons were for URLs of the form file:///builds/tinderbox/Cm1.1-M1.8/startup-test.html?begin=1166555443305 - Camino caches a new icon for each new value of "begin", and we run ten startup tests per build, so this starts to add up. Almost all of the things saved in the cache had an exp_date in the past. Checking my own local IconCache, I found that it, too, has a lot of expired entries. It's a more reasonable 16MB, which is still kind of a lot for an icon cache. Smokey says that his is 32MB.
Property List Editor hangs trying to expand the root tree of the IconCacheIndex.plist (the file is 756 KB, for 3818 key/value pairs). The oldest expiry date I can find is 2006-05-25T08:47:47Z, for a site I never remember visiting (so must have been a QA visit, once and gone). I'm very sure this didn't use to be a problem, and I also know that I've crashed Camino at least once since 2006-05-25T08:47:47Z (which should invalidate all the caches, right; a crash certainly requires me to re-visit sites to get the site icons to appear in the UI.) Something is broken here pretty badly :(
Privacy implications too.
We just ran cb-x1 out of disk space due (in part) to this bug; we can turn this off in tinderbox, but we need to look out for our users.
Severity: normal → major
Flags: camino1.6?
Flags: camino1.5.2?
Keywords: privacy
Yeah, I suck. I wonder if this got worse when we started showing favicons for local files.
Bug 391864 should help the tinderboxen as well.
I've been trying to think about how to fix this without exacerbating the vanishing bookmark icon problem. My current thought is that, at shutdown, we purge any expired entries that *aren't* in the in-memory cache. I haven't verified yet, but I assume all the bookmark icons are requested on launch, so they would all be live in the memory cache and thus protected from purging. We'd probably slow the first quit for everyone somewhat, but I'd expect minimal impact on all future shutdowns. I'll do some timing tests; in the meantime, any other issues I'm missing?
(In reply to comment #6) > verified yet, but I assume all the bookmark icons are requested on launch, so > they would all be live in the memory cache and thus protected from purging. We have nasty issues with PACs/proxies because of that (bug 351678); I once did some nspr logging and seem to recall it showed us requesting them, at least.
Well, we have to look them up at least from the cache on startup or we'll have no bookmark favicons at all, so that's something we'll have to resolve either way (and I've been putting some thought into how we might do that).
Assignee: nobody → stuart.morgan
Not making 1.5.2, but as we continue to think about this, it's definitely something we want to take on 1.5.x when we get a patch.
Flags: camino1.5.3?
Flags: camino1.5.2?
Flags: camino1.5.2-
Attached patch fixSplinter Review
Implements comment 6. It took 7-8 seconds to clean up my 19 MB cache with icons going back to early 2006, which was long enough that it appeared to be a hang on quit. We don't want to do that to all upgrading users, so I've put in a 1-2 second limit that will spread the initial cleanup across a few launch/quit cycles. It's still perceptible, but for a one-time thing I don't think it's worth trying to come up with a more complex amortization scheme. Once the initial cleanup was done, it took less than a tenth of a second to check the remaining 1MB worth of cached images at shutdown, which I don't see as a problem.
Attachment #284262 - Flags: review?(mark)
Target Milestone: --- → Camino1.6
Comment on attachment 284262 [details] [diff] [review] fix Just for reference, did you happen to catch how many quit cycles it would take to work through the entire icon cache?
Attachment #284262 - Flags: review?(mark) → review+
It took 5 for me, with that cache, on my laptop (although that would vary from trial to trial I'm sure, since it's 1-2 seconds per quit). I don't have enough of a sense of how much the cache size may vary across our whole user base to be able to estimate in general.
Attachment #284262 - Flags: superreview?(mikepinkerton)
That sounds reasonable to me.
Attachment #284262 - Flags: superreview?(mikepinkerton) → superreview+
Landed on trunk and MOZILLA_1_8_BRANCH. Once we've let this bake for a little while, we can land it for 1.5.4.
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: camino1.6? → camino1.6+
Keywords: privacyfixed1.8.1.10
Resolution: --- → FIXED
Just for the record, since I looked at this tonight to make sure it was working: My icon cache was sitting at 36 MB/approx 4300 files (that's up from 28 MB back in July). After about 8 quits/restarts (with my WindowState.plist moved aside, so I was just loading a few icons in the bookmark bar and the cbo start page icon), I was at 32.7 MB/3900 files, and it had deleted 1 of my 10 oldest icons (which dated from May 2006). Number of icons deleted per run seemed to range from about 40 to about 70. The 1-2 secs at quit seems to be just the right time on my 1.33 GHz PB G4; any longer and I'd be concerned. It's clearly going to take some time to purge a large cache, especially for people who don't quit often, but I still think this is the right thing to do, and we should take this for 1.5.4.
Landed on the CAMINO_1_5_BRANCH for 1.5.4.
Flags: camino1.5.4? → camino1.5.4+
Whiteboard: [camino-1.5.4]
Some additional data, since I was talking with Sam about this tonight: my site icon cache today was 32.7 MB/4300 files. Apparently I don't quit enough. (I don't think there's anything reasonable we can do, though.) (I purged it down to 20.8 MB/2585 files, including 3 more of those 10 oldest, by about 30 quit/restart cycles.)
I filed bug 410143 for more work, to address comment 18.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: