diff options
author | Jason Carey <jcarey@argv.me> | 2015-12-01 15:43:18 -0500 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2015-12-02 14:01:34 -0500 |
commit | 45d947729a0315accb6d4f15a6b06be6d9c19fe7 (patch) | |
tree | ebd99ffde3bad1101142284ca8e89c2524b96533 /src/mongo/scripting | |
parent | 0eb5b0ecc379a5ad1b00aab56e7432ce76d13ac9 (diff) | |
download | mongo-45d947729a0315accb6d4f15a6b06be6d9c19fe7.tar.gz |
SERVER-21715 call JS_SetGCParametersBasedOnAvailableMemoryr3.2.0-rc6r3.2.0
Improves gc performance if we indicate to spidermonkey that we have more
than 512megs of ram available.
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/mozjs/implscope.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp index 4d9a85eb13a..903b46529ef 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -260,6 +260,9 @@ MozJSImplScope::MozRuntime::MozRuntime(const MozJSScriptEngine* engine) { // large pages, like 4MB? JS_SetNativeStackQuota(_runtime, available.get() - (64 * 1024)); } + + // The memory limit is in megabytes + JS_SetGCParametersBasedOnAvailableMemory(_runtime, kMallocMemoryLimit / (1024 * 1024)); } _context = JS_NewContext(_runtime, kStackChunkSize); |