Understanding Android memory usage
summary
Android memory pressure triggers kswapd to reclaim cached pages and then the low memory killer to terminate processes in priority order (native, system_server, persistent, foreground, perceptible, services, home, previous, cached), so app behavior on a 2GB versus 512MB device (and Chrome’s PSS falling as pressure rises) matters. Measure impact with PSS via adb shell dumpsys meminfo -s (or -a, showmap, debug malloc when needed), profile the Java heap with Android Studio Memory Profiler, and shrink APKs; test consistent use cases on devices with ample free RAM.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:38Memory and the Android ecosystem
- 2:40Physical memory on device
- 3:162 GB device under memory pressure
- 5:43Android process list and the low memory killer
- 11:33512 MB device under memory pressure
- 12:59Application memory impact with shared pages
- 16:45User value / memory impact tradeoff
- 20:13Memory impact depends on a bunch of things
- 21:49Gmail memory for various platform configs
- 23:39Chrome PSS under increasing memory pressure
- 26:29Android Studio's memory profiler
- 27:41But what about the rest of the memory?
- 33:35Non-Java allocations are often tied to Java allocations
- 35:09Things that take space in your APK tend to take memory at runtime too
- 36:591. How memory use impacts a device
related talks
36mAndroid memory and games
07mAndroid memory tools and best practices
38mOptimize your app performance for the next generation of Android
40m640K ought to be enough for anyone
38mOptimize your app performance for the next generation of Android
53mMemory on Android, Leaks and OOM
18mEnd the Senseless Killing: Improving Memory Management for Mobile Operating Systems
37mMemory Hotplug on Android
