Bug 1219914 - increase jemalloc's 'lg_dirty_mult' parameter from the default of 3 to 6 draft
authorAlex Gaynor <agaynor@mozilla.com>
Wed, 05 Apr 2017 15:44:55 -0400
changeset 560491 a887c908dfd808d5ac59933d6b3a2e9a2ed30a6c
parent 560424 f914d40a48009c5acd1093e9939cc0ec035696dd
child 623715 7f8bec7dd37f952ba8ad0f0963ec73bcbbf0453c
push id53434
push userbmo:agaynor@mozilla.com
push dateTue, 11 Apr 2017 13:59:20 +0000
bugs1219914
milestone55.0a1
Bug 1219914 - increase jemalloc's 'lg_dirty_mult' parameter from the default of 3 to 6 This has the impact of reducing the page size cache from ~20MB of memory to 1-2MB. This is important because we now pay that penalty in memory usage for each process, and we'd rather not. The performance impact of this change is believed to be minimal, as a similar change we implemented in mozjemalloc without significant impact. MozReview-Commit-ID: FOxxuDnwz2c
build/mozconfig.common
memory/build/jemalloc_config.cpp
--- a/build/mozconfig.common
+++ b/build/mozconfig.common
@@ -18,10 +18,12 @@ ac_add_options --enable-release
 
 # Enable checking that add-ons are signed by the trusted root
 MOZ_ADDON_SIGNING=${MOZ_ADDON_SIGNING-1}
 # Disable enforcing that add-ons are signed by the trusted root
 MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-0}
 
 ac_add_options --enable-js-shell
 
+ac_add_options --enable-jemalloc=4
+
 . "$topsrcdir/build/mozconfig.automation"
 . "$topsrcdir/build/mozconfig.rust"
--- a/memory/build/jemalloc_config.cpp
+++ b/memory/build/jemalloc_config.cpp
@@ -27,17 +27,17 @@
 
 /* Override some jemalloc defaults */
 #ifdef DEBUG
 #define MOZ_MALLOC_BUILD_OPTIONS ",junk:true"
 #else
 #define MOZ_MALLOC_BUILD_OPTIONS ",junk:free"
 #endif
 
-#define MOZ_MALLOC_OPTIONS "narenas:1,tcache:false"
+#define MOZ_MALLOC_OPTIONS "lg_dirty_mult:6,narenas:1,tcache:false"
 MFBT_DATA const char* je_(malloc_conf) =
   MOZ_MALLOC_OPTIONS MOZ_MALLOC_BUILD_OPTIONS;
 
 #ifdef ANDROID
 #include <android/log.h>
 
 static void
 _je_malloc_message(void* cbopaque, const char* s)