[FR]: Add MemoryBudgetManager sample

Offen
#514 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@WSixx arbeitet bereits daran.

Seit 16.11.2026.

  • #515 von @WSixx — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
20/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
android, kotlin
Bereich
mobile

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
Kotlin
Sterne
1.8k
Forks
554
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus android/platform-samples

Alle Issues in android/platform-samples

Ähnliche Issues

Weitere Issues zu Kotlin

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.