fdtrack: GC before checking fd count.
Test: treehugger Change-Id: I0f1d59ae4240a24f8b8e4b015c1923acb1140bce
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user