summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Kalesh Singh <kaleshsingh@google.com> 2022-11-10 16:00:00 -0800
committer Kalesh Singh <kaleshsingh@google.com> 2022-11-15 09:02:58 -0800
commit84d812ffb4d5ed049137afb9aa19f4de17ec8e7d (patch)
tree7dfdadc50717bbb21ebd357fca9facf6721ecaad /libs/androidfw/StringPool.cpp
parent0f461bf42776889053609127b01e44e493b437ef (diff)
AMS: Proactive Kills - Minimal Implementation
Under certain scenarios, PSI triggers may not wake up LMKD in time to relieve system resource contention. This is especially true in the case of MGLRU which makes smarter reclaim decisions and genereates less PSI. Additionally, reclaim of anonymous memory suffers when swap is full and under pressure the anon pages can be reactivated in an attempt to swap. This causes hot/cold page inversion. MGLRU detects this situation and doesn't swap but it leads to a similar scenario where the anon generations are in effect inverted (hot/cold generation inversion) if the swap contention doesn't decrease. To safe guard these cases, impose a minimum free swap threshold. The default is 10% but will be configurable from experiment flags. When swap drops below this limit, the LRU cached app is killed to help relieve swap pressure. Most cached apps contribute to swap usage because of the proactive app compaction, which may not necessarily mean we have memory pressure. Note that Andorid uses ZRAM (in-memory compressed swap). ZRAM size is virtual, so imposing a threshold on swap is not the same as reserving swap space. Bug: 249601646 Test: Run ACT, observe low swap kills Change-Id: I089d37fc067b9a85aabbd70b4513a209dfafa96d Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions