Open Bug 1270394 Opened 9 years ago Updated 3 years ago

Replace remove-only approximate frame visibility updates with forgetting visibility for everything outside the viewport

Categories

(Core :: Layout, defect)

defect

Tracking

()

People

(Reporter: seth, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file)

When we're under memory pressure, we currently run a "remove-only" approximate frame visibility update that attempts to remove frames from the approximately visible frames set, but doesn't allow adding new ones. This can help free some memory, but the result doesn't necessarily do a good job of minimizing the number of frames we consider visible (which translates directly into how much image memory is locked and cannot be freed), the frames that stay in the set may not be the same as the frames that are visible in the viewport, and doing the frame tree walk to do the update is costly. We can get better results much more cheaply now that we have IN_VIEWPORT visibility. When we get a memory pressure notification, we'll just empty the frame visibility sets for IN_DISPLAYPORT and MAY_BECOME_VISIBLE (i.e. approximate) visibility. That will quickly free the maximum amount of memory we can while ensuring that we keep around everything that's actually in the viewport. The next time we paint (in the case of IN_DISPLAYPORT visibility) or do an approximate frame visibility update (in the case of MAY_BECOME_VISIBLE visibility), those sets will get repopulated, but emptying them gives the system time (and memory!) to recover when it's under memory pressure.
Here's the patch. Simple, should give better results, and we can remove a little bit of code.
Attachment #8749069 - Flags: review?(mstange)
Blocks: 1270691
Attachment #8749069 - Flags: review?(mstange) → review+

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: seth.bugzilla → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: