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
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index fad9e0e..06e66d6 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -2285,7 +2285,9 @@
     // 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.
-    mallopt(M_PURGE, 0);
+    if (mallopt(M_PURGE_ALL, 0) != 1) {
+      mallopt(M_PURGE, 0);
+    }
   }
 
   pid_t pid = fork();