Open Bug 1410238 Opened 7 years ago Updated 2 years ago

Postpone malloc accounting of nursery strings until they are tenured

Categories

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

enhancement

Tracking

()

ASSIGNED

People

(Reporter: sfink, Assigned: sfink)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The idea here is that if you do malloc accounting for strings allocated in the nursery, then you might end up doing a bunch of major GCs for short-lived strings (that may even have been freed by the time you fire off the GC.)

Forking off from bug 903519 because it adds complexity and doesn't appear to be necessary for the initial landing. (And may not be worth it at all.)

We probably ought to do a census of out-of-line strings in the nursery to see if it's at all significant.
I guess this introduces a different weirdness (problem?): we don't trigger minor GCs off of malloc pressure -- at least not directly; a malloc-triggered major GC will do a minor GC first. But with this patch, you could accumulate a huge amount of malloc memory in the nursery. So before landing something like this, we might want to consider tracking nursery malloc memory separately and having it trigger minor GCs.

If we knew how much memory was allocated, a better way to do this would be to have a single malloc memory accumulator, and when it hit a threshold, first do a minor GC and only then choose whether or not a major GC is needed based on how much memory is left.
Priority: -- → P2
Blocks: 1507445
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: