summaryrefslogtreecommitdiff
path: root/api/api_test.go
diff options
context:
space:
mode:
author TYM Tsai <tymtsai@google.com> 2024-12-04 17:35:24 +0800
committer TYM Tsai <tymtsai@google.com> 2024-12-05 13:39:11 +0800
commit1fafab3b6c0c0df76a021e8e616888b98d90a066 (patch)
tree4b960e54102e9af297151e63a6e4cc7529cdd223 /api/api_test.go
parent8218dda7770fd63674ad46664e45a96699194e93 (diff)
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
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions