[FR]: Add MemoryBudgetManager sample

Open
#514 0 comments 0 reactions 0 assignees View on GitHub

@WSixx is already working on this.

Since Nov 16, 2026.

  • #515 by @WSixx — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile

Research direction

Start with the specified sample path, then read the official App memory budgets guide linked in the issue. Implement the listed telemetry, budget transitions, lifecycle-aware listener and cache eviction, and document the manifest clauses and adb inspection commands. Confirm the sample demonstrates the API and its release-only usage; pull request #515 is already open.

Written by the indexing model from the issue text.

Description

enhancement
Is there an existing FR for this?
  • I have searched the existing issues
For which area is this FR?

General

Is it for a specific sample?

samples/performance/memory/src/main/java/com/example/platform/performance/memory/MemoryBudgetSample.kt

Describe the feature request

Add a sample module (:samples:performance:memory) demonstrating the Android 17 QPR2 (API level 37.2 / CINNAMON_BUN_2) MemoryBudgetManager API and <memory-budget> manifest declarations, following the official App memory budgets guide.

Scope:

  • On-demand memory usage and budget telemetry (processCurrentUsageBytes, packageCurrentUsageBytes, processBudgetBytes, packageBudgetBytes, and LIMIT_IS_DISABLED).
  • Discrete workload budget transitions (processBudgetBytes, clearProcessBudget(), idempotency, and IllegalArgumentException ceiling validation).
  • Lifecycle-aware OnOverBudgetListener registration (ON_START / ON_STOP) with fast, allocation-free high-yield LruCache<String, Bitmap> eviction.
  • Documentation for <memory-budget> manifest clauses, release-only usage, and adb inspection commands (dumpsys meminfo and dumpsys activity processes).
Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
Kotlin
Stars
1.8k
Forks
554
Avg merge
1d 23h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/platform-samples

All issues in android/platform-samples

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.