Bug 1108045 - Junk memory with jemalloc3. r=glandium
authorGuilherme Goncalves <guilherme.p.gonc@gmail.com>
Tue, 23 Dec 2014 07:44:00 -0500
changeset 221381 a0315fb0c4f91e2611fd5f9993bba246ac8cc791
parent 221380 9e126e97e3470194832c2c799307e331aeaafe8c
child 221382 3d59a98d33c939f4ac6bdf24f1c5c976f1232586
push id28019
push userryanvm@gmail.com
push dateFri, 26 Dec 2014 19:40:56 +0000
treeherdermozilla-central@893064841be2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1108045
milestone37.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 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);