Enable fdtrack in system_server.
Spawn a thread that monitors the current fd count, and enables fdtrack to hunt down leaks when it gets too high. Bug: http://b/140703823 Test: setprop persist.sys.debug.fdtrack_enable_threshold; stop; start; logcat -c; killall -39 system_server; logcat -d | grep fdtrack Change-Id: If5831f57d47e6958112abced181f07e18e6a7261
This commit is contained in:
@@ -353,6 +353,12 @@ public final class SystemServer {
|
||||
*/
|
||||
private static native void initZygoteChildHeapProfiling();
|
||||
|
||||
|
||||
/**
|
||||
* Spawn a thread that monitors for fd leaks.
|
||||
*/
|
||||
private static native void spawnFdLeakCheckThread();
|
||||
|
||||
/**
|
||||
* The main entry point from zygote.
|
||||
*/
|
||||
@@ -484,6 +490,11 @@ public final class SystemServer {
|
||||
initZygoteChildHeapProfiling();
|
||||
}
|
||||
|
||||
// Debug builds - spawn a thread to monitor for fd leaks.
|
||||
if (Build.IS_DEBUGGABLE) {
|
||||
spawnFdLeakCheckThread();
|
||||
}
|
||||
|
||||
// Check whether we failed to shut down last time we tried.
|
||||
// This call may not return.
|
||||
performPendingShutdown();
|
||||
|
||||
Reference in New Issue
Block a user