diff --git a/tests/SystemMemoryTest/host/src/com/android/tests/sysmem/host/Cujs.java b/tests/SystemMemoryTest/host/src/com/android/tests/sysmem/host/Cujs.java index b605e62db0f22..6500428253f63 100644 --- a/tests/SystemMemoryTest/host/src/com/android/tests/sysmem/host/Cujs.java +++ b/tests/SystemMemoryTest/host/src/com/android/tests/sysmem/host/Cujs.java @@ -31,6 +31,12 @@ public class Cujs { * Runs the critical user journeys. */ public void run() throws TestException { + // Do an explicit GC in the system server process as part of the test + // case to reduce GC-related sources of noise. + // SIGUSR1 = 10 is the magic signal to trigger the GC. + int pid = mDevice.getPidForProcess("system_server"); + mDevice.executeShellCommand("kill -10 " + pid); + // Invoke the Device Cujs instrumentation to run the cujs. // TODO: Consider exercising the system in other interesting ways as // well.