diff options
| author | 2020-10-16 18:19:08 +0000 | |
|---|---|---|
| committer | 2020-10-16 18:19:08 +0000 | |
| commit | b402e6930aa3988a0125845f3192870d83cbc189 (patch) | |
| tree | 1446be9788500c31128bea616aa7db6b732ac818 | |
| parent | 46d86297c97ed23600f1e66fcec75a6cfa7c07ee (diff) | |
| parent | c12d11de03b036b20d5824cc9d2ba7c82c1676a1 (diff) | |
Merge "Zygote: disable heap 0'ing in apps." am: 1e19124f42 am: d44577e9e6 am: c12d11de03
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1462849
Change-Id: I3181a2664f53f05692b01d053360a2389141bdc9
| -rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index dadf08f2cc90..95c295a4784c 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -80,6 +80,7 @@ #include <bionic/mte.h> #include <bionic/mte_kernel.h> #include <cutils/fs.h> +#include <cutils/memory.h> #include <cutils/multiuser.h> #include <cutils/sockets.h> #include <private/android_filesystem_config.h> @@ -647,6 +648,13 @@ static void PreApplicationInit() { // Set the jemalloc decay time to 1. mallopt(M_DECAY_TIME, 1); + + // Avoid potentially expensive memory mitigations, mostly meant for system + // processes, in apps. These may cause app compat problems, use more memory, + // or reduce performance. While it would be nice to have them for apps, + // we will have to wait until they are proven out, have more efficient + // hardware, and/or apply them only to new applications. + process_disable_memory_mitigations(); } static void SetUpSeccompFilter(uid_t uid, bool is_child_zygote) { |