Shrink unused nursery space in idle time
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(2 files)
Landing bug 1677765 and bug 1681533 both caused AWSY regressions because they affected the number of nursery collections. It turns out AWSY is very sensitive to that.
Performing too many nursery collections can shrink the nursery when it is in use, causing more things to be tenured and increasing memory use. But also, performing too few nursery collections can leave a large and unused nursery taking up memory unnecessarily.
Currently we collect the nursery when it is full, or nearly so if we have idle time. We should also collect the nursery when it isn't being used to give it the opportunity to shrink and release memory.
Assignee | ||
Comment 1•4 years ago
|
||
The aim here is to detect when the nursery isn't being used much and collect it
so that it can shrink itself (this doesn't change the sizing heuristics). This
ensures the nursery doesn't hold on to memory that could be better used for
other things.
There are many possible approaches but I went for the simplest - a fixed
timeout. If the nursery is above minimum size and as not been collected for 2
seconds then we collect it (if we're idle). This sounds drastic but is actually
quite a long time in terms of nursery collections, and only happens during idle
time when there is no JS code running.
This appears to fix the AWSY regressions for the other patches that affected
the number of nursery collections.
Assignee | ||
Comment 2•4 years ago
|
||
I always forget whether size is before or after resizing, so I added both.
Also I added the runtime pointer.
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dc3237308ff0 Collect the nursery during idle time if appears to be underused r=sfink https://hg.mozilla.org/integration/autoland/rev/a426ccf784b7 Add some more information to the nursery profiling output r=sfink
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dc3237308ff0
https://hg.mozilla.org/mozilla-central/rev/a426ccf784b7
Description
•