Skip to content
Commit dff9e1cc authored by Jernej Virag's avatar Jernej Virag
Browse files

Trigger background memory trim when SystemUI is idle

SystemUI never receives BACKGROUND level trim commmand - this means that
several caches (especially font) can stay around for a long time before
they reach their set limits and trigger a trim. This causes significant
increase in private memory in cases where many font variants are
allocated - for example when lockscreen clock is animated through
different font variations.

This adds a BACKGROUND trim command when SysUI goes idle after
transitioning to AoD or simply turning off the screen. This is the
closest SysUI has to "background" state where it can safely cleanup its
resources.

Bug: 275486055
Test: atest ResourceTrimmer
      memory benchmark with LockscreenAodTransitionBenchmark showing
      ~20MB of descrease in RssAnon after a 30 iteration benchmark run
Change-Id: Ia4abd0d9c3cf3b3a71bdd31f1009f37b18c99ae9
parent 2d319490
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment