diff options
author | Christopher Ferris <cferris@google.com> | 2020-03-31 16:39:49 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2020-03-31 16:39:49 -0700 |
commit | 42ee32379deb615c6554ac8325417f451e987b35 (patch) | |
tree | 5025083404a8e7c2f24d9a444840303d62c4a604 /include | |
parent | 94c497862b75d61a5ce4a2156d6ac417f9c51a8c (diff) | |
download | platform_external_jemalloc_new-42ee32379deb615c6554ac8325417f451e987b35.tar.gz platform_external_jemalloc_new-42ee32379deb615c6554ac8325417f451e987b35.tar.bz2 platform_external_jemalloc_new-42ee32379deb615c6554ac8325417f451e987b35.zip |
Only retain for 64 bit.
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
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal_defs.h | 5 |
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 */ |