Skip to content

Commit

Permalink
SERVER-21715 call JS_SetGCParametersBasedOnAvailableMemory
Browse files Browse the repository at this point in the history
Improves gc performance if we indicate to spidermonkey that we have more
than 512megs of ram available.
  • Loading branch information
hanumantmk committed Dec 2, 2015
1 parent 0eb5b0e commit 45d9477
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mongo/scripting/mozjs/implscope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 45d9477

Please sign in to comment.