Open Bug 1787526 Opened 2 years ago Updated 2 years ago

Implement partial nursery collections (semispace-ish)

Categories

(Core :: JavaScript: GC, enhancement, P2)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: sfink, Assigned: sfink)

References

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

Details

(Whiteboard: [sp3])

Attachments

(10 files)

(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details

The goal is to reduce unnecessary tenuring, when we tenure short-lived but recent allocations because we hit the end of the nursery. These appear to be fairly frequent in the matrix-react benchmark, for example.

Current design: allocate a large contiguous region of virtual memory space, roughly double the desired size of the nursery. Use the second half as the nursery space initially. When collecting, leave some portion in the nursery (call it K bytes). Back up the start of the nursery-allocatable region by K and run the mutator again to fill it up. Collect all but the K most recently allocated bytes, including the K-sized chunk left over from the previous iteration. Keep backing up the nursery start until hitting the beginning of the virtual memory area, then jump back to using the second half and repeat. In pictures, using 1/3 the size of the initial nursery-allocatable space as K:

[______] initial empty nursery
[___XXX] allocate into 2nd half
[_____X] collect all but last 1/3 of allocated space
[__XXXX] allocate into region just before preserved space
[____X_] collect all but most recent K sized chunk
[_XXXX_] allocate
[___X__] collect
[XXXX__] allocate
[__X___] collect
[__XXXX] now allocating into 2nd half again
[_____X] repeat

There are many details, but that's the basic idea.

Blocks: GC
Severity: -- → N/A
Priority: -- → P2
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: