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

Skip to content
Commit 1fafab3b authored by TYM Tsai's avatar TYM Tsai
Browse files

Avoid lambda code to cache computer snapshot

The lambda will automatically retain a reference for use within
the code block. In addition, snapshotComputer() also creates a
new object for the snapshot everytime. If the lambda is called
multiple times and some places keep them for a long time, the
snapshot object becomes huge. It causes OOM in the system_server
process and leads to platform reset.
To avoid the problem, use Supplier instead and then gain snapshot
the supplier.

Bug: 381996338
Flag: EXEMPT bugfix
Test: atest FrameworksMockingServicesTests:com.android.server.pm
Change-Id: I57422392167012905243db0856b6eb5648b56489
parent 8218dda7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment