Bug 1518138 - Make RunNextCollectorTimer trigger full GCs to address out of memory errors running JS reftests r=smaug a=lizzard
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 03 Sep 2019 12:21:45 +0000
changeset 554956 df3bfb6c871b0023a7f7b75993e5f16e8cadacc8
parent 554955 36b891a1c27e083fca0c5eb22cf9146373c4d61c
child 554957 a23c865aef7f1e42922d14be7287a8c068064aea
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, lizzard
bugs1518138
milestone70.0
Bug 1518138 - Make RunNextCollectorTimer trigger full GCs to address out of memory errors running JS reftests r=smaug a=lizzard This doesn't fix the underlying problem but makes RunNextCollectorTimer more aggressive in what it does. Testing shows this substantially reduces the max GC heap size while running these tests as well as vsize and RSS. Hopefully this will fix the problem with the tests failing while we work out a good solution for the underlying issue. Differential Revision: https://phabricator.services.mozilla.com/D44378
dom/base/nsJSEnvironment.cpp
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1901,16 +1901,21 @@ uint32_t nsJSContext::CleanupsSinceLastG
 // static
 void nsJSContext::RunNextCollectorTimer(JS::GCReason aReason,
                                         mozilla::TimeStamp aDeadline) {
   if (sShuttingDown) {
     return;
   }
 
   if (sGCTimer) {
+    if (aReason == JS::GCReason::DOM_WINDOW_UTILS) {
+      // Force full GCs when called from reftests so that we collect dead zones
+      // that have not been scheduled for collection.
+      sNeedsFullGC = true;
+    }
     GCTimerFired(nullptr, reinterpret_cast<void*>(aReason));
     return;
   }
 
   nsCOMPtr<nsIRunnable> runnable;
   if (sInterSliceGCRunner) {
     sInterSliceGCRunner->SetDeadline(aDeadline);
     runnable = sInterSliceGCRunner;