Bug 604747 - Set GC max heap size to 4GB in JS shell (r=gregor)
authorBill McCloskey <wmccloskey@mozilla.com>
Mon, 19 Sep 2011 15:22:31 -0700
changeset 78473 9208ee94b0120e0c18ab370f1fb7cfb8a0698339
parent 78472 104fb6df714f1a9f45b01cde35530ac60b28651b
child 78474 7004388d9ae8255ff54773c4b09bbc0f889510de
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgregor
bugs604747
milestone9.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 604747 - Set GC max heap size to 4GB in JS shell (r=gregor)
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5718,20 +5718,23 @@ main(int argc, char **argv, char **envp)
 
 #ifdef XP_WIN
     // Set the timer calibration delay count to 0 so we get high
     // resolution right away, which we need for precise benchmarking.
     extern int CALIBRATION_DELAY_COUNT;
     CALIBRATION_DELAY_COUNT = 0;
 #endif
 
-    rt = JS_NewRuntime(160L * 1024L * 1024L);
+    /* Use the same parameters as the browser in xpcjsruntime.cpp. */
+    rt = JS_NewRuntime(32L * 1024L * 1024L);
     if (!rt)
         return 1;
 
+    JS_SetGCParameter(rt, JSGC_MAX_BYTES, 0xffffffff);
+
     JS_SetTrustedPrincipals(rt, &shellTrustedPrincipals);
     JS_SetRuntimeSecurityCallbacks(rt, &securityCallbacks);
 
     if (!InitWatchdog(rt))
         return 1;
 
     cx = NewContext(rt);
     if (!cx)