Bug 1135141 - Do not do background sweeping for zealous GCs to avoid fragmentation; r=jonco

--HG--
extra : rebase_source : 4bdc6c9af1b6a34fb7394e2f8d0c884b114b3fee
This commit is contained in:
Terrence Cole 2015-02-23 14:25:37 -08:00
parent 19fa938cf7
commit b0a16305a8

View File

@ -5576,8 +5576,13 @@ GCRuntime::finishCollection(JS::gcreason::Reason reason)
lastGCTime = currentTime;
// If this is an OOM GC reason, wait on the background sweeping thread
// before returning to ensure that we free as much as possible.
if (reason == JS::gcreason::LAST_DITCH || reason == JS::gcreason::MEM_PRESSURE) {
// before returning to ensure that we free as much as possible. If this is
// a zeal-triggered GC, we want to ensure that the mutator can continue
// allocating on the same pages to reduce fragmentation.
if (reason == JS::gcreason::LAST_DITCH ||
reason == JS::gcreason::MEM_PRESSURE ||
reason == JS::gcreason::DEBUG_GC)
{
gcstats::AutoPhase ap(stats, gcstats::PHASE_WAIT_BACKGROUND_THREAD);
rt->gc.waitBackgroundSweepOrAllocEnd();
}