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

Commit 9242fadf authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Add app compaction throttling.

Implement configurable flags that

1. Filters full app compaction by the anon RSS use of a process, i.e.
do not compact processes that are using an amount of memory
lower than the flag value. By default the flag is 12000kB, which
from experimental data indicates we get 85% of the compaction gains
with 50% of the number of compactions. The filter can be disabled
entirely by setting a value of 0.
The default will be later tuned with further experiments.

2. Filters full compaction by the delta in RSS usage since the effect
of compaction last time the process was (fully) compacted. This is
to try and not compact if we think that there are diminishing returns.
The default is 8000kB, which from experimental data suggests we get 90% of
the compaction gains with 50% of the compaction events. The filter can
be disabled by setting a value of 0.
The default will be later tuned with further experiments.

3. Filters all types of compaction for processes in certain procstate,
by default PROCESS_STATE_BROADCAST_RECEIVER. The filter can be disabled
by setting the empty string and the default will be tuned with further
experiments.

BUG: 128427978
Test: atest FrameworksMockingServicesTests:AppCompactorTest
Change-Id: I71fffc52a232cd5608742d9f36965a4de6494b56
parent 89df2a72
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ class ActivityManagerDebugConfig {
    static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false;
    static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false;
    static final boolean DEBUG_BROADCAST_DEFERRAL = DEBUG_BROADCAST || false;
    static final boolean DEBUG_COMPACTION = DEBUG_ALL || false;
    static final boolean DEBUG_LRU = DEBUG_ALL || false;
    static final boolean DEBUG_MU = DEBUG_ALL || false;
    static final boolean DEBUG_NETWORK = DEBUG_ALL || false;
+262 −11

File changed.

Preview size limit exceeded, changes collapsed.

+229 −4

File changed.

Preview size limit exceeded, changes collapsed.