Bug 943924 - Use default stack size for JS worker threads on Windows, r=billm.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 06 Dec 2013 16:22:20 -0800
changeset 174035 61cda1f28ce43a43c6e6c04d1f5a2187343f67ee
parent 174034 86307d61bcb31e28dab1f71e6bbcf8cb2f429827
child 174036 2c5a87384e5b425112dce31fd7b8ba0e1ff44638
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs943924
milestone28.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 943924 - Use default stack size for JS worker threads on Windows, r=billm.
js/src/jsworkers.cpp
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -353,17 +353,25 @@ js::WaitForOffThreadParsingToFinish(JSRu
                 parseInProgress |= !!state.threads[i].parseTask;
             if (!parseInProgress)
                 break;
         }
         state.wait(WorkerThreadState::CONSUMER);
     }
 }
 
+#ifdef XP_WIN
+// The default stack size for new threads on Windows is 1MB, but specifying a
+// smaller explicit size to NSPR on thread creation causes our visible memory
+// usage to increase. Just use the default stack size on Windows.
+static const uint32_t WORKER_STACK_SIZE = 0;
+#else
 static const uint32_t WORKER_STACK_SIZE = 512 * 1024;
+#endif
+
 static const uint32_t WORKER_STACK_QUOTA = 450 * 1024;
 
 bool
 WorkerThreadState::init()
 {
     JS_ASSERT(numThreads == 0);
 
     if (!runtime->useHelperThreads())