Skip to content

Commit 6d7a552

Browse files
committed
bionic: use jemalloc by default and allow opt-in to scudo (3/4)
Overall, jemalloc performs 23.4% better than Scudo while consuming 1.7% less amount of memory in system/extra's real-world memory_replay traces: https://docs.google.com/spreadsheets/d/19wLanILSw_l2d7oot3VvcZiFSLzPRWNb_a5ZyA3aFSU/edit?usp=sharing Scudo performs fairly well for a hardened memory allocator, but we're optimizing for performance. Tests were performed by statically linking memory_replay under QSSI 14. Android userspace has been stopped before performing all benchmarks, and each test was executed 10 times with an idle detector in between to reduce noise and errors. The entire test took about 3 days: https://github.com/arter97/android_memory_replay_helper This commit has been inspired from ProtonAOSP/android_bionic@b220489 Change-Id: I5f6955bac87d87f9ef931c9be2fd43ac5d8fbcd7 Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
1 parent 4af38d9 commit 6d7a552

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libc/Android.bp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cc_defaults {
125125
malloc_pattern_fill_contents: {
126126
cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"],
127127
},
128-
malloc_not_svelte: {
128+
malloc_use_scudo: {
129129
cflags: ["-DUSE_SCUDO"],
130130
},
131131
},
@@ -136,7 +136,7 @@ cc_defaults {
136136
}
137137

138138
libc_scudo_product_variables = {
139-
malloc_not_svelte: {
139+
malloc_use_scudo: {
140140
cflags: ["-DUSE_SCUDO"],
141141
whole_static_libs: ["libscudo"],
142142
exclude_static_libs: [
@@ -148,9 +148,6 @@ libc_scudo_product_variables = {
148148

149149
// Defaults for native allocator libs/includes to make it
150150
// easier to change.
151-
// To disable scudo for the non-svelte config remove the line:
152-
// product_variables: libc_scudo_product_variables,
153-
// in the cc_defaults below.
154151
// ========================================================
155152
cc_defaults {
156153
name: "libc_native_allocator_defaults",

0 commit comments

Comments
 (0)