aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-04-05 09:59:28 -0700
committerChristopher Ferris <cferris@google.com>2019-04-09 20:26:21 +0000
commit25b667ba3910fb6ad74e2cad1bd1d66d8de9369f (patch)
treec2fc6155506e509081b8f5d54fd1e89464bf6958
parentedf6701d373a397b75c0f3ff979d6b18095294f5 (diff)
downloadplatform_external_jemalloc_new-25b667ba3910fb6ad74e2cad1bd1d66d8de9369f.tar.gz
platform_external_jemalloc_new-25b667ba3910fb6ad74e2cad1bd1d66d8de9369f.tar.bz2
platform_external_jemalloc_new-25b667ba3910fb6ad74e2cad1bd1d66d8de9369f.zip
Fix performance of multiple same size allocations.
It was found that keeping just a few allocations of the same size around (even up to only 3) increases the allocation time significantly. This appears to be because I set the minimum tcache entries to 1. Removing this and the performance comes mostly all of the way back. There is still some loss, but probably just due to a different bin layout than jemalloc 4.x. This does increase the PSS slightly for many processes. About 1MB in my trace runs. However, it increases the performance of most multiple allocations by a factor of three. Bug: 129743239 Test: Ran memory_replay on all traces. Test: Ran new bionic benchmarks to verify things get better. Change-Id: Iff41d5b5002919c4df03fcb7d742e501f9e38b8e Merged-In: Iff41d5b5002919c4df03fcb7d742e501f9e38b8e (cherry picked from commit 0af4ee86dfa643feb786d659dbb219133c776a34)
-rw-r--r--Android.bp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Android.bp b/Android.bp
index e2a29024..4fa62844 100644
--- a/Android.bp
+++ b/Android.bp
@@ -59,9 +59,6 @@ common_c_local_includes = [
// 1 << XX is the maximum sized allocation that will be in the tcache.
android_common_cflags = [
- "-DANDROID_TCACHE_NSLOTS_SMALL_MIN=1",
- "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
-
// Default some parameters to small values to minimize PSS.
// These parameters will be overridden by android_product_variables
// for non-svelte configs.
@@ -76,6 +73,7 @@ android_product_variables = {
malloc_not_svelte: {
cflags: [
"-DANDROID_ENABLE_TCACHE",
+ "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
"-UANDROID_NUM_ARENAS",
"-DANDROID_NUM_ARENAS=2",