Only compact zones where we can reclaim a useful amount of memory

RESOLVED FIXED in Firefox 39

Status

()

Core
JavaScript: GC
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

(Blocks: 1 bug)

unspecified
mozilla39
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox39 fixed)

Details

Attachments

(1 attachment)

At the moment we compact all zones that we collect in a shrinking GC.  However this is wasteful, because we may not be able to free much or any memory at all.

We should skip compacting zones if we cannot free up a certain proportion of their allocated memory.
Created attachment 8567100 [details] [diff] [review]
skip-unnecessary-compaction

This patch calculates the number of arenas that we are going to free up for each zone before deciding whether to compact or skip that zone.  The decision is based on the GC reason so that OOM or memory pressure GCs will free up all possible memory.  Otherwise we only compact if we can free at least 2% of the zone's GC heap memory (I made this number up so tuning may be required).
Attachment #8567100 - Flags: review?(terrence)
Attachment #8567100 - Flags: review?(terrence) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/55afade66202
https://hg.mozilla.org/mozilla-central/rev/55afade66202
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox39: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Depends on: 1136597
You need to log in before you can comment on or make changes to this bug.