Repository navigation
Conversation
WSixx
requested review from
alabiaga,
ashnohe,
madebymozart and
yrezgui
as code owners
November 16, 2026 23:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a new
:samples:performance:memorysample demonstratingMemoryBudgetManager(Android 17 QPR2 / API level 37.2,Build.VERSION_CODES_FULL.CINNAMON_BUN_2) and the recommended best practices for app memory budgets.Changes
:samples:performance:memory:MemoryBudgetSampleusingMemoryBudgetManagerwith:MinSdkFullBox(Build.VERSION_CODES_FULL.CINNAMON_BUN_2) and@RequiresApi.processCurrentUsageBytes,packageCurrentUsageBytes,processBudgetBytes,packageBudgetBytes, handlingLIMIT_IS_DISABLED) without continuous polling.clearProcessBudget()for baseline restoration, tight 48 MB pressure test, idempotency, andIllegalArgumentExceptionceiling validation).OnOverBudgetListenerregistration (ON_START/ON_STOP) keeping callbacks fast/allocation-free and evicting a high-yieldLruCache<String, Bitmap>.samples/performance/memory/src/main/AndroidManifest.xmldocumenting<memory-budget>clauses and release-only best practices in comments (intentionally not merged globally into:appto avoid affecting unrelated debug/test samples).samples/performance/README.mdandsamples/performance/memory/README.md(covering<memory-budget>attributes,src/release/AndroidManifest.xml,adb shell dumpsys activity processes,adb shell dumpsys meminfo, andutilities/android_mem_monitor.py).:shared):MinSdkFullBoxinMinSdkBox.ktto checkBuild.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA && Build.VERSION.SDK_INT_FULL >= minSdkFull.:samples:performance:memoryinsettings.gradle.kts,app/build.gradle.kts,ApiSurface.kt,SampleDemo.kt, and rootREADME.md.:appcompileSdktorelease(37) { minorApiLevel = 2 }(required bycheckDebugAarMetadatafor the new dependency).Verification
./gradlew spotlessCheck --init-script gradle/spotless-init.gradle.kts --no-configuration-cache— passed./gradlew :samples:performance:memory:lintDebug :shared:lintDebug :app:lintDebug :app:assembleDebug— passed (0lint warnings/errors in:samples:performance:memory)Fixes #514 🦕