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

Commit 795821c5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set defaults for cached and empty processes."

parents 698008d2 444ad6a7
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -304,18 +304,19 @@ final class ActivityManagerConstants extends ContentObserver {
    // we have no limit on the number of service, visible, foreground, or other such
    // processes and the number of those processes does not count against the cached
    // process limit.
    public int CUR_MAX_CACHED_PROCESSES;
    public int CUR_MAX_CACHED_PROCESSES = DEFAULT_MAX_CACHED_PROCESSES;

    // The maximum number of empty app processes we will let sit around.
    public int CUR_MAX_EMPTY_PROCESSES;
    public int CUR_MAX_EMPTY_PROCESSES = computeEmptyProcessLimit(CUR_MAX_CACHED_PROCESSES);

    // The number of empty apps at which we don't consider it necessary to do
    // memory trimming.
    public int CUR_TRIM_EMPTY_PROCESSES;
    public int CUR_TRIM_EMPTY_PROCESSES = computeEmptyProcessLimit(MAX_CACHED_PROCESSES) / 2;

    // The number of cached at which we don't consider it necessary to do
    // memory trimming.
    public int CUR_TRIM_CACHED_PROCESSES;
    public int CUR_TRIM_CACHED_PROCESSES =
            (MAX_CACHED_PROCESSES - computeEmptyProcessLimit(MAX_CACHED_PROCESSES)) / 3;

    /**
     * Packages that can't be killed even if it's requested to be killed on imperceptible.
@@ -552,8 +553,6 @@ final class ActivityManagerConstants extends ContentObserver {

            // For new flags that are intended for server-side experiments, please use the new
            // DeviceConfig package.

            updateMaxCachedProcesses();
        }
    }