Closed Bug 467960 Opened 17 years ago Closed 1 month ago

Global bfcache eviction looks at already-closed windows

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bzbarsky, Unassigned)

Details

(Keywords: perf)

The global (max total cached viewer) eviction in bfcache looks at all live session history entries and evicts the entry that's furthest from current in any of them. This is fine, but when we close a tab or window there is a lag before the session history is destroyed (has to wait for GC, at the very least). As a result, it's possible for eviction to keep things in these defunct session histories while evicting things from "live" ones. This was causing mochitest failures when histories from earlier tests interfered with a later test. I see several possible solutions here: 1) Do nothing, just work around this in the tests. 2) nsDocShell::Destroy flushes its session history before dropping its reference to it. This changes the behavior people see, but I think it might be a good idea given that restoring from that history into a different docshell would be ... suboptimal. 3) nsDocShell::Destroy just flushes all cached content viewers in its session history. 4) Session histories have a flag that indicates whether they're attached to a docshell, and eviction prefers to evict from session histories without such a flag. Option 4 means that content viewers in the seamonkey "undo close tab" session history will be preferentially flushed. Not sure whether that's ok. My personal preference is probably option 3, but if people have other opinions, or ideas on who else would care to voice an opinion, please speak up or CC as needed.
OS: Mac OS X → All
Hardware: PC → All
Severity: normal → S3

I think SHIP+BFCache changed the behavior here. Things get evicted very explicitly when closing a window.

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.