mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1585159 - Don't grow nursery in a last-ditch GC r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D48292 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
32fc4906ae
commit
b6d24ade18
@ -1552,6 +1552,17 @@ void js::Nursery::shrinkAllocableSpace(size_t newCapacity) {
|
||||
}
|
||||
|
||||
void js::Nursery::minimizeAllocableSpace() {
|
||||
if (capacity_ < roundSize(tunables().gcMinNurseryBytes())) {
|
||||
// The nursery is already smaller than the minimum size. This can happen
|
||||
// because changing parameters (like an increase in minimum size) can only
|
||||
// occur after a minor GC. See Bug 1585159.
|
||||
//
|
||||
// We could either do the /correct/ thing and increase the size to the
|
||||
// configured minimum size. Or do nothing, keeping the nursery smaller. We
|
||||
// do nothing because this can be executed as a last-ditch GC and we don't
|
||||
// want to add memory pressure then.
|
||||
return;
|
||||
}
|
||||
shrinkAllocableSpace(roundSize(tunables().gcMinNurseryBytes()));
|
||||
}
|
||||
|
||||
|
11
js/src/jit-test/tests/gc/bug-1585159.js
Normal file
11
js/src/jit-test/tests/gc/bug-1585159.js
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
// Set a nursery size larger than the current nursery size.
|
||||
gcparam("minNurseryBytes", 1024 * 1024);
|
||||
gcparam("maxBytes", gcparam("gcBytes") + 4096);
|
||||
|
||||
// Allocate something in the nursery.
|
||||
let obj = {'foo': 38, 'bar': "A string"};
|
||||
|
||||
// Trigger a last-ditch GC.
|
||||
print(gc(0, "last-ditch"));
|
||||
|
Loading…
Reference in New Issue
Block a user