[cc] Simplify and adjust memory limits on Android #4636
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Android, compositor memory limits are derived from system memory and
dalvik memory limits. This code was noted as outdated in 2017 (see
linked bug), and as a result didn't work the way it should have.
This is because:
carveouts
Based on field data, the large majority of devices is running with a
computed limit of 256MiB, with some devices using 96MiB. This CL
simplifies the code to:
Which mostly matches the current in-the-wild reality. These limits are
likely not optimal, but at least this simplifies the code. Also, lower
the priority cutoff to "NICE_TO_HAVE", which matches desktop, and
reality, since ALLOW_EVERYTHING is lowered to NICE_TO_HAVE elsewhere in
the code (see PriorityCutoffToTileMemoryLimitPolicy() for instance).
This is gated behind a feature flag, to make sure that this is not
breaking things.
This change is backported from m120+.
(cherry picked from commit 42b97eaa9deace1c188434ccac37ee22223ade4f)
Bug: 380310632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4860245