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

Commit ed3f60fe authored by Yan Han's avatar Yan Han
Browse files

Use MemAvailable to better estimate free memory

Apps can call ActivityManager#getMemoryInfo to get an estimate for the
amount of free memory in the system. This is calculated as
MemFree + Cached, from /proc/meminfo.

However, /proc/meminfo also exposes MemAvailable, which more accurately
estimates free memory. For details, see
https://git.kernel.org/torvalds/c/34e431b.

On low-RAM TV devices, MemFree + Cached significantly overestimates
free memory, so switching to MemAvailable would improve performance
by encouraging apps to use a more appropriate amount of memory.

Bug: 340918025
Test: manual - with logging in ActivityManagerService#getMemoryInfo

Change-Id: I477b6ea944993627a5af6603256ebaaaffb84778
parent a90e5fb3
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