Open Bug 1814817 Opened 2 years ago Updated 2 years ago

Dynamically adjust dirty page limits based on browser activity.

Categories

(Core :: Memory Allocator, enhancement)

enhancement

Tracking

()

People

(Reporter: pbone, Unassigned)

References

(Depends on 1 open bug)

Details

jemalloc has a dirty page limit, it will try to madvise pages until the number of dirty pages is below its limit. The limit is per-arena.

We may be able to improve page load performance by increasing this limit during page load (and other busy activity) and reducing it / nudging jemalloc during idle time. Other ideas, many courtesy of smaug:

  • We would want to set some kind of limit for every arena, in addition to arenas' own limits.
  • Something like content process which has a top level browsing context in a foreground tab could use more page cache than some process which has all its browsing contexts in background tabs
  • and third party iframes might get also smaller cache than top level one

Oh, we could also consider using ProcessPriorityManager since a bunch of other policy is managed here for what content processes are doing.

Bug 1815069 is already doing a lot of this work. And Bug 1814815 is also underway. Rather than making this a dupe I'd like to use it to unify those two bugs and extend them further. I'd like to make sure the multiple reasons to increase/decrease the dirty page cache don't interfere with each-other (eg by being applied in a non-FIFO order). And to make sure they make sense when multiple states are active at the same time.

Depends on: 1815069, 1814815
You need to log in before you can comment on or make changes to this bug.