[ Web Proxy ]
URL:
Viewing: https://developer.android.com/games/optimize/memory-overview [Back]  [Original]

About memory management  |  Android game development  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Send feedback

About memory management Stay organized with collections Save and categorize content based on your preferences.

Memory optimization is critical to delivering stable, high-performance gaming experiences on Android. This guide provides an overview of why memory efficiency matters, how the Android operating system manages process memory limits, and the new memory metrics in the Google Play Console to help you monitor and improve your game's technical quality.

The importance of memory optimization

Optimizing your game's memory is essential to maintain player retention, expand device compatibility, and comply with platform quality standards:

Understanding memory in Android

To design effective memory-budgeting strategies, developers must understand how the Android platform manages physical memory and how it measures your game's active footprint.

Core Android memory concepts

For foundational concepts regarding platform-level memory management, see the official Memory Management Overview documentation. This resource covers four architectural areas:

The total memory footprint metric

The platform-level Android 17 Memory Limiter evaluate process consumption using Total Memory Footprint rather than total resident size (RSS) or virtual memory size.

Total Memory Footprint = Anonymous RSS (RssAnon) + Uncompressed Swap (VmSwap)

To prevent games from exceeding platform limits, developers must understand exactly what these metrics represent at a system level. For more information about these metrics, physical RAM allocations, and how file-backed pages are handled, see Understanding RSS and Swap Metrics in the Monitor Memory Usage guide.

Memory constraints

To maintain system stability and ensure that applications don't consume excessive resources, the Android platform manages memory limits for running processes.

Memory Limiter in Android 17 and higher

Android 17 (API level 37) and higher manage strict, per-app memory limits using Linux cgroup v2 to prevent individual apps from causing system-wide instability. For more details on the technical implementation, see the AOSP Memory Limiter Guide and Prioritizing Memory Efficiency: Essential Steps for Android 17 Blog.

Monitor memory usage

To effectively optimize your game's memory, you must first understand how the Android platform measures its footprint. Android 17 updates the memory metric to track the sum of Anonymous RSS (RssAnon) and uncompressed Swap (VmSwap), excluding file-backed or GPU-private memory. This guide details how to leverage system-level tools such as Perfetto and meminfo, implement diagnostic APIs such as ProfilingManager and onTrimMemory, and extract precise memory allocations within Unity and Unreal Engine. Understand how to accurately profile your game and avoid the performance stutters associated with traditional runtime memory polling.

For more information, see Monitor Memory Usage.

Note: The Memory Advice API beta is deprecated and no longer recommended for use.

Memory reduction strategies

While game engines simplify cross-platform development, their default memory handling can trigger OS-level memory limits. This page details practical optimization steps specifically tailored for Unity and Unreal Engine. Understand why relying on Java-based onTrimMemory can cause deadlocks in Unityand how to use native lifecycle callbacks instead. You'll also discover key asset-level optimizations, such as using ASTC 8x8 texture compression and configuring asset unloads, to keep your game running smoothly on all hardware tiers.

Send feedback

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page