Bug 1108045 - Junk memory with jemalloc3. r=glandium
authorGuilherme Goncalves <guilherme.p.gonc@gmail.com>
Tue, 23 Dec 2014 07:44:00 -0500
changeset 238119 a0315fb0c4f91e2611fd5f9993bba246ac8cc791
parent 238118 9e126e97e3470194832c2c799307e331aeaafe8c
child 238120 3d59a98d33c939f4ac6bdf24f1c5c976f1232586
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1108045
milestone37.0a1
Bug 1108045 - Junk memory with jemalloc3. r=glandium
memory/build/jemalloc_config.c
--- a/memory/build/jemalloc_config.c
+++ b/memory/build/jemalloc_config.c
@@ -14,19 +14,25 @@
 /* we tolerate around 4MiB of dirty pages on most platforms, except for B2G,
  * where our limit is 1MiB
  */
 #define MOZ_MALLOC_PLATFORM_OPTIONS ",lg_dirty_mult:8"
 #else
 #define MOZ_MALLOC_PLATFORM_OPTIONS ",lg_dirty_mult:6"
 #endif
 
+#ifdef DEBUG
+#define MOZ_MALLOC_BUILD_OPTIONS ",junk:true"
+#else
+#define MOZ_MALLOC_BUILD_OPTIONS ",junk:free"
+#endif
+
 #define MOZ_MALLOC_OPTIONS "narenas:1,lg_chunk:20,tcache:false"
 MFBT_DATA const char * je_(malloc_conf) =
-  MOZ_MALLOC_OPTIONS MOZ_MALLOC_PLATFORM_OPTIONS;
+  MOZ_MALLOC_OPTIONS MOZ_MALLOC_PLATFORM_OPTIONS MOZ_MALLOC_BUILD_OPTIONS;
 
 #ifdef ANDROID
 #include <android/log.h>
 
 static void
 _je_malloc_message(void *cbopaque, const char *s)
 {
   __android_log_print(ANDROID_LOG_INFO, "GeckoJemalloc", "%s", s);