am_kill too many background
14745 if (!app.killedBackground) { 14746 if (app.curAdj >= ProcessList.HIDDEN_APP_MIN_ADJ) { 14747 numHidden++; 14748 if (numHidden > mProcessLimit) { 14749 Slog.i(TAG, "No longer want " + app.processName 14750 + " (pid " + app.pid + "): hidden #" + numHidden); 14751 EventLog.writeEvent(EventLogTags.AM_KILL, app.pid, 14752 app.processName, app.setAdj, "too many background"); 14753 app.killedBackground = true; 14754 Process.killProcessQuiet(app.pid); 14755 } 14756 } 14757 if (!app.killedBackground && app.isolated && app.services.size() <= 0) { 14758 // If this is an isolated process, and there are no 14759 // services running in it, then the process is no longer 14760 // needed. We agressively kill these because we can by 14761 // definition not re-use the same process again, and it is 14762 // good to avoid having whatever code was running in them 14763 // left sitting around after no longer needed. 14764 Slog.i(TAG, "Isolated process " + app.processName 14765 + " (pid " + app.pid + ") no longer needed"); 14766 EventLog.writeEvent(EventLogTags.AM_KILL, app.pid, 14767 app.processName, app.setAdj, "isolated not needed"); 14768 app.killedBackground = true; 14769 Process.killProcessQuiet(app.pid); 14770 } 14771 if (app.nonStoppingAdj >= ProcessList.HOME_APP_ADJ 14772 && app.nonStoppingAdj != ProcessList.SERVICE_B_ADJ 14773 && !app.killedBackground) { 14774 numTrimming++; 14775 } 14776 }
821 int mProcessLimit = ProcessList.MAX_HIDDEN_APPS; 822 int mProcessLimitOverride = -1;
38 // This is a process only hosting activities that are not visible, 39 // so it can be killed without any disruption. 40 static final int HIDDEN_APP_MAX_ADJ = 15; 41 static int HIDDEN_APP_MIN_ADJ = 9;
Serviceの強制終了 個人的にAndroid備忘録/ウェブリブログ
OOM(Out Of Memory) Killer