Merge "Set the decay timer for all forked apps."

am: 232ce7868d

Change-Id: Ia6e16a2f6b8e551a48d6f3ab4472d097284436f4
This commit is contained in:
Christopher Ferris
2017-05-16 14:10:18 +00:00
committed by android-build-merger

View File

@@ -27,6 +27,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <grp.h> #include <grp.h>
#include <inttypes.h> #include <inttypes.h>
#include <malloc.h>
#include <mntent.h> #include <mntent.h>
#include <paths.h> #include <paths.h>
#include <signal.h> #include <signal.h>
@@ -519,6 +520,9 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra
// The child process. // The child process.
gMallocLeakZygoteChild = 1; gMallocLeakZygoteChild = 1;
// Set the jemalloc decay time to 1.
mallopt(M_DECAY_TIME, 1);
// Clean up any descriptors which must be closed immediately // Clean up any descriptors which must be closed immediately
DetachDescriptors(env, fdsToClose); DetachDescriptors(env, fdsToClose);