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

Commit f3122755 authored by Hans Boehm's avatar Hans Boehm
Browse files

Add System.runFinalization() call

Lone calls to System.gc() generally don't do anything.
Runtime.getRuntime().gc() would force a GC, but it would be ineffective
without waiting for reference processing and finalization to complete.
Adding the runFinalization() call implicitly makes the preceding GC call
effective.

Bug: 183912710
Test: Treehugger
Change-Id: I0f4806b8e3f9ca898eb7ea1b1c8de14aa94e2646
parent f90282c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -452,6 +452,7 @@ public final class SystemServer {
                if (maxFd > enableThreshold) {
                    // Do a manual GC to clean up fds that are hanging around as garbage.
                    System.gc();
                    System.runFinalization();
                    maxFd = getMaxFd();
                }