Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 571aa6fb authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Switch to purge all unused memory to kernel.

The new option purges all memory, but could take some extra time.

However, there isn't much memory in the zygote so this should not
incur much extra time during the purge operation.

Bug: 243851006

Test: Verified that the zygote and zygote 64 on oriole reduce the
Test: RSS by about 300K on average.
Change-Id: Ic5eac43813163efb2c049ed280c2f15a89c3fa18
parent ae41acbe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2285,8 +2285,10 @@ pid_t zygote::ForkCommon(JNIEnv* env, bool is_system_server,
    // region shared with the child process we reduce the number of pages that
    // transition to the private-dirty state when malloc adjusts the meta-data
    // on each of the pages it is managing after the fork.
    if (mallopt(M_PURGE_ALL, 0) != 1) {
      mallopt(M_PURGE, 0);
    }
  }

  pid_t pid = fork();