Closed Bug 2042334 Opened 5 months ago Closed 5 months ago

Prefer to allocate from more full chunks first in the buffer allocator to reduce the total number of chunks

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file, 1 obsolete file)

To try to reduce the total number of chunks used we should prefer to allocate out of more full chunks when possible, with the idea being to let less full chunks empty out and be removed. This made a noticeable difference when we did it for the GC arena allocator.

Chunks don't have to be completely sorted for this to be useful. We can roughly sort chunks by amount of free space using a radix sort as part of sweeping.

This does a radix sort to roughtly sort swept chunks into 8 buckets based on
free space.

We have to take care to clear the cached tail pointers if the main thread has
merged the chunk lists back while we were unlocked. We can detect this by the
destination list now being empty. This will also mess up to sort order. We will
tolerate this.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch

I originally filed this because I saw what seemed like an unnecessarily large number of chunks being used in my main Firefox instance. Since landing this bug however this has got worse if anything so I'm going to request this is backed out while I investigate.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 153 Branch → ---

This reverts commit c65b22427960cc88b0111b80ee50b4ef289c553d.

No plans to land this for now. Bug 2045637 should reduce the total number of chunks used.

Status: REOPENED → RESOLVED
Closed: 5 months ago → 5 months ago
Resolution: --- → WONTFIX
Attachment #9589676 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: