diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 6000fb56299d5..d73e7dd501408 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -519,6 +520,9 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra // The child process. gMallocLeakZygoteChild = 1; + // Set the jemalloc decay time to 1. + mallopt(M_DECAY_TIME, 1); + // Clean up any descriptors which must be closed immediately DetachDescriptors(env, fdsToClose);