Bug 1367905 - Try to run GC/CC slices, including forgetSkippable, during idle time, tweaks to keep reftest memory usage lower, r=mccr8

--HG--
extra : rebase_source : 850e4f25ef1ac18b768dc50dc4fa9b77f0743080
This commit is contained in:
Olli Pettay 2017-06-10 02:41:06 +03:00
Родитель ce6010c7d6
Коммит 5591c27af9
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -240,6 +240,10 @@ public:
Create(CollectorRunnerCallback aCallback, uint32_t aDelay, Create(CollectorRunnerCallback aCallback, uint32_t aDelay,
int64_t aBudget, bool aRepeating, void* aData = nullptr) int64_t aBudget, bool aRepeating, void* aData = nullptr)
{ {
if (sShuttingDown) {
return nullptr;
}
RefPtr<CollectorRunner> runner = RefPtr<CollectorRunner> runner =
new CollectorRunner(aCallback, aDelay, aBudget, aRepeating, aData); new CollectorRunner(aCallback, aDelay, aBudget, aRepeating, aData);
runner->Schedule(false); // Initial scheduling shouldn't use idle dispatch. runner->Schedule(false); // Initial scheduling shouldn't use idle dispatch.
@ -1921,7 +1925,10 @@ InterSliceGCRunnerFired(TimeStamp aDeadline, void* aData)
{ {
nsJSContext::KillInterSliceGCRunner(); nsJSContext::KillInterSliceGCRunner();
MOZ_ASSERT(sActiveIntersliceGCBudget > 0); MOZ_ASSERT(sActiveIntersliceGCBudget > 0);
int64_t budget = sActiveIntersliceGCBudget; // We use longer budgets when timer runs since that means
// there hasn't been idle time recently and we may have significant amount
// garbage to collect.
int64_t budget = sActiveIntersliceGCBudget * 2;
if (!aDeadline.IsNull()) { if (!aDeadline.IsNull()) {
budget = int64_t((aDeadline - TimeStamp::Now()).ToMilliseconds()); budget = int64_t((aDeadline - TimeStamp::Now()).ToMilliseconds());
} }

Просмотреть файл

@ -41,7 +41,6 @@ var gTimeoutHook = null;
var gFailureTimeout = null; var gFailureTimeout = null;
var gFailureReason; var gFailureReason;
var gAssertionCount = 0; var gAssertionCount = 0;
var gTestCount = 0;
var gDebug; var gDebug;
var gVerbose = false; var gVerbose = false;
@ -143,11 +142,7 @@ function StartTestURI(type, uri, timeout)
// The GC is only able to clean up compartments after the CC runs. Since // The GC is only able to clean up compartments after the CC runs. Since
// the JS ref tests disable the normal browser chrome and do not otherwise // the JS ref tests disable the normal browser chrome and do not otherwise
// create substatial DOM garbage, the CC tends not to run enough normally. // create substatial DOM garbage, the CC tends not to run enough normally.
++gTestCount; windowUtils().runNextCollectorTimer();
if (gTestCount % 500 == 0) {
CU.forceGC();
CU.forceCC();
}
// Reset gExplicitPendingPaintCount in case there was a timeout or // Reset gExplicitPendingPaintCount in case there was a timeout or
// the count is out of sync for some other reason // the count is out of sync for some other reason