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

Commit 7c61fea8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Perform once GCs on all app process when system ready"

parents 9df67b06 5b6edc1c
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -11449,6 +11449,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            }
            mStackSupervisor.resumeTopActivitiesLocked();
            sendUserSwitchBroadcastsLocked(-1, mCurrentUserId);
            performGcsForAllLocked();
        }
    }
@@ -17267,6 +17268,24 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
    }
    /**
     * Perform GCs on all processes, we only call it one time when system ready
     */
    final void performGcsForAllLocked() {
        final ArrayMap<String, SparseArray<ProcessRecord>> map = mProcessNames.getMap();
        int mapSize = map.size();
        ProcessRecord proc = null;
        for (int i = 0; i < mapSize; i++) {
            String name = map.keyAt(i);
            SparseArray<ProcessRecord> array = map.get(name);
            for (int j = 0; j < array.size(); j++) {
                proc = array.valueAt(j);
                performAppGcLocked(proc);
            }
        }
    }
    /**
     * If all looks good, perform GCs on all processes waiting for them.
     */