How Android works
Zygote, Dalvik & ART
Why every app is a copy of one process, and how your Kotlin actually executes.
6 pages69 min6 interactive9400 words
- 01Zygote: the mother of processesEvery app and system_server is a fork of one warm process. Zygote is why an app can start in a few hundred milliseconds despite having no main() of its own.beginner12 mininteractive
- 02DEX files and the 64K limitDEX packs every class in your app into one file with shared tables. That design is why an APK is small, why a single file has a 65,536-method ceiling, and why multidex exists.intermediate12 mininteractive
- 03The Dalvik eraFrom 2008 to 2014 Android ran your code on a JIT-less VM designed for 2008 hardware. Dalvik's constraints explain a lot of the platform's shape, including why ART exists.intermediate11 mininteractive
- 04ART: ahead-of-time, then hybridART began as the runtime that compiled everything at install. It is now a hybrid of interpreter, JIT and profile-guided AOT, shipped as an updatable module — and each swing of that pendulum was a reaction to the previous one's cost.nerd12 mininteractive
- 05Garbage collection and jankA GC pause of 20 ms is a dropped frame. ART's collector history is a fifteen-year attempt to make that number independent of how much memory the app is using.nerd11 mininteractive
- 06JNI, the NDK and ABIsJNI is the bridge between managed code and C++. It is powerful, easy to misuse, and the reason an APK contains lib/ directories for four different CPU architectures.nerd11 mininteractive
Test yourself
Test yourself: Zygote, Dalvik & ART
How is a new app process created from Zygote?