Bug 694335 - Enable jemalloc on MacOS 10.5. r=khuey
authorJustin Lebar <justin.lebar@gmail.com>
Thu, 27 Oct 2011 11:28:45 -0400
changeset 79477 c4e4af6b7ae42c8a59516935f18a47875211f2df
parent 79476 0a6e289031711fc14cdc30fe07cb6b4cbce7a224
child 79478 2dcf884ff0f8c4b40a1f79f417e12e8c22dde92a
push id21408
push userkhuey@mozilla.com
push dateTue, 01 Nov 2011 14:32:20 +0000
treeherdermozilla-central@cd9add22f090 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs694335
milestone10.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 694335 - Enable jemalloc on MacOS 10.5. r=khuey Note: Our RSS metrics should show that this patch regresses memory usage, but they're wrong. See the bug for details.
configure.in
memory/jemalloc/jemalloc.c
--- a/configure.in
+++ b/configure.in
@@ -2038,20 +2038,17 @@ case "$target" in
     esac
     ;;
 
 *-darwin*)
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MOZ_OPTIMIZE_FLAGS="-O3"
     _PEDANTIC=
-    # Due to performance regressions, statically disable jemalloc on 10.5. See bug 414946.
-    if test "$HAVE_64BIT_OS"; then
-        MOZ_MEMORY=1
-    fi
+    MOZ_MEMORY=1
     CFLAGS="$CFLAGS -fno-common"
     CXXFLAGS="$CXXFLAGS -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     # Check whether we're targeting OS X or iOS
     AC_CACHE_CHECK(for iOS target,
                    ac_cv_ios_target,
--- a/memory/jemalloc/jemalloc.c
+++ b/memory/jemalloc/jemalloc.c
@@ -5937,17 +5937,18 @@ MALLOC_OUT:
 
     /*
      * We only use jemalloc with the 10.6 SDK:
      *   - With the 10.5 SDK, madvise doesn't work, leading to a 20% memory
      *     usage regression (bug 670492).
      *   - With the 10.7 SDK, jemalloc causes the browser to hang (bug 670175).
      */
 
-    osx_use_jemalloc = (default_zone->version == SNOW_LEOPARD_MALLOC_ZONE_T_VERSION);
+    osx_use_jemalloc = (default_zone->version == LEOPARD_MALLOC_ZONE_T_VERSION ||
+                        default_zone->version == SNOW_LEOPARD_MALLOC_ZONE_T_VERSION);
 
     /* Allow us dynamically turn off jemalloc for testing. */
 	if (getenv("NO_MAC_JEMALLOC"))
         osx_use_jemalloc = false;
 
     if (osx_use_jemalloc) {
         size_t size;