Bug 921809 - Only trigger full GCs due to excessive malloc'ing when on the main thread, r=billm.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 30 Sep 2013 09:18:59 -0600
changeset 149278 e412eef638b1c8775cd9f692321844ffe27f9782
parent 149277 4e93e321909de787011d658fa27f8ecbb0842d2e
child 149279 3ef9d1885496981c642abea6d5907e58adc52d9d
push id25380
push userryanvm@gmail.com
push dateMon, 30 Sep 2013 20:16:36 +0000
treeherdermozilla-central@1332fc1c15e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs921809
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 921809 - Only trigger full GCs due to excessive malloc'ing when on the main thread, r=billm.
js/src/vm/Runtime.cpp
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -732,17 +732,18 @@ JSRuntime::updateMallocCounter(JS::Zone 
         onTooMuchMalloc();
     else if (zone)
         zone->updateMallocCounter(nbytes);
 }
 
 JS_FRIEND_API(void)
 JSRuntime::onTooMuchMalloc()
 {
-    TriggerGC(this, JS::gcreason::TOO_MUCH_MALLOC);
+    if (CurrentThreadCanAccessRuntime(this))
+        TriggerGC(this, JS::gcreason::TOO_MUCH_MALLOC);
 }
 
 JS_FRIEND_API(void *)
 JSRuntime::onOutOfMemory(void *p, size_t nbytes)
 {
     return onOutOfMemory(p, nbytes, nullptr);
 }