GC: decommit unused chunks in the background

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: terrence, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P3][js4b2g])

(Reporter)

Description

5 years ago
Currently, when a Chunk becomes empty, it gets added to a list of free chunks and only freed if it does not get re-used within the next two GC's. On memory constrained systems such as android and B2G, keeping this memory alive and committed can result in OOM through C allocations that cannot use our GC heap. We should simply decommit any chunks that are waiting in this list so that their backing physical memory can be re-used by other allocations in the system.

This should be a less costly, but more complex, solution to the problem that Bug 887652 also solves.
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink][js4b2g]
Whiteboard: [MemShrink][js4b2g] → [MemShrink:P3][js4b2g]
(Reporter)

Updated

4 years ago
Blocks: 1008337
(Assignee)

Updated

4 years ago
Assignee: general → nobody
(Reporter)

Comment 1

2 years ago
This happened either when we moved everything to ChunkPool or during the decommit-on-the-background: I don't remember. In any case, we assert that it is true in every GC:

http://searchfox.org/mozilla-central/rev/064025c802c22cd5ad122746733cbd34ea47393c/js/src/jsgc.cpp#3117-3119
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.