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

Commit 192102c3 authored by Josh Gao's avatar Josh Gao
Browse files

fdtrack: GC before checking fd count.

Test: treehugger
Change-Id: I0f1d59ae4240a24f8b8e4b015c1923acb1140bce
parent 3ede7b49
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -439,6 +439,12 @@ public final class SystemServer {
            boolean enabled = false;
            while (true) {
                int maxFd = getMaxFd();
                if (maxFd > enableThreshold) {
                    // Do a manual GC to clean up fds that are hanging around as garbage.
                    System.gc();
                    maxFd = getMaxFd();
                }

                if (maxFd > enableThreshold && !enabled) {
                    Slog.i("System", "fdtrack enable threshold reached, enabling");
                    System.loadLibrary("fdtrack");