summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
author Isaac J. Manjarres <isaacmanjarres@google.com> 2025-01-02 18:40:57 -0800
committer Isaac J. Manjarres <isaacmanjarres@google.com> 2025-01-03 12:10:59 -0800
commitb631927cfdd636521332d731e0155d9501d99524 (patch)
tree82da370b99516894a231d4a04f626bda2ea292be /libs/androidfw/AssetManager.cpp
parentfda961639598675bfdfe26cc11740559c43dbe83 (diff)
Improve lost RAM calculation by removing kernel driver CMA allocations
CMA memory can be in one of the following four states at any given point in time: 1. Free, in which case it is already accounted for when computing lost RAM, since lost RAM subtracts free memory from total memory. 2. Allocated to userspace processes, in which case the memory has already been accounted for when computing lost RAM as part of the total PSS value that is computed. 3. Allocated for storing compressed memory (ZRAM) on Android kernels. This is already accounted for in the lost RAM calculation, since the calculation includes the memory consumed by ZRAM. 4. Allocated to a kernel driver, in which case the memory is not accounted for with the current kernel memory usage calculation. This memory ends up being counted as lost RAM. Android exposes an interface that can be used to calculate how much memory kernel drivers are allocating through CMA. Therefore, use this interface to calculate this value, and improve the lost RAM calculation. Bug: 371518137 Bug: 228238851 Change-Id: Ia37ffbf861ac01708d90a10f0c76df745a33597d Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
0 files changed, 0 insertions, 0 deletions