aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2020-03-31 16:39:49 -0700
committerChristopher Ferris <cferris@google.com>2020-04-16 16:13:18 -0700
commitd3a7616aa26eb5f0b6c46de96730305e21cd3f35 (patch)
tree5025083404a8e7c2f24d9a444840303d62c4a604
parent91f65f46593dd87b272773bba1f6cc5fe1fbf8c4 (diff)
downloadplatform_external_jemalloc_new-d3a7616aa26eb5f0b6c46de96730305e21cd3f35.tar.gz
platform_external_jemalloc_new-d3a7616aa26eb5f0b6c46de96730305e21cd3f35.tar.bz2
platform_external_jemalloc_new-d3a7616aa26eb5f0b6c46de96730305e21cd3f35.zip
Only retain for 64 bit.android11-dev
In 32 bit, the va space can be exhausted very easily. Change the jemalloc defaults to only retain for 64 bit to avoid this exhaustion. The performance of traces does get slightly worse, but most stay about the same. This should only affect devices that use malloc svelte, all other devices are on scudo. Bug: 142556796 Bug: 140079007 Test: Ran traces and verified va space is much lower. Test: Compared benchmarks with and without retaining. Test: Ran bionic unit tests. Test: Ran jemalloc tests. Test: Ran malloc stress tests. Change-Id: Iaec8276582f880145a1ca5ebbaa65789f46d2bf2 Merged-In: Iaec8276582f880145a1ca5ebbaa65789f46d2bf2 (cherry picked from commit 42ee32379deb615c6554ac8325417f451e987b35)
-rw-r--r--include/jemalloc/internal/jemalloc_internal_defs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/jemalloc/internal/jemalloc_internal_defs.h b/include/jemalloc/internal/jemalloc_internal_defs.h
index 052bd11c..37ab466f 100644
--- a/include/jemalloc/internal/jemalloc_internal_defs.h
+++ b/include/jemalloc/internal/jemalloc_internal_defs.h
@@ -237,7 +237,12 @@
* common sequences of mmap()/munmap() calls will cause virtual memory map
* holes.
*/
+#if defined(__LP64__)
+// Only use retain for 64 bit since virtual memory can be exhausted
+// very easily when running in 32 bit.
+// See b/142556796.
#define JEMALLOC_RETAIN
+#endif
/* TLS is used to map arenas and magazine caches to threads. */
/* #undef JEMALLOC_TLS */