Generated by GPT-5-mini| Android Runtime | |
|---|---|
| Name | Android Runtime |
| Developer | |
| Programming language | C++, Java (programming language), Kotlin (programming language) |
| Operating system | Android (operating system) |
| Platform | ARM architecture, x86, x86-64, ARM64 |
| Genre | Runtime environment |
| License | Apache License |
Android Runtime
Android Runtime (ART) is the managed runtime used by Android (operating system) to execute applications written primarily in Java (programming language) and Kotlin (programming language), replacing the earlier Dalvik virtual machine. ART provides a managed execution environment with ahead-of-time and just-in-time compilation, memory management, and runtime services that integrate with system components such as the Linux kernel, Google Play services, and device-specific firmware. Designed and maintained by Google engineers, ART has evolved through contributions from projects and teams within Open Handset Alliance partners and device manufacturers like Samsung and Qualcomm.
ART originated as part of Android's broader evolution from Dalvik, introduced experimentally by Google in Android 4.4 (KitKat) to improve application performance and battery life. The transition to ART as the default runtime occurred in Android 5.0 (Lollipop) after a period of testing and refinement involving the Android Open Source Project community, chipset vendors such as MediaTek, and handset makers including HTC and Sony. Subsequent Android releases, including Android 6.0 (Marshmallow), Android 7.0 (Nougat), and later versions led by Sundar Pichai-era teams, brought advances in ahead-of-time compilation, garbage collection, and profiling tools. ART's development has interacted with broader initiatives like Project Treble and Android Runtime optimizations from Google engineering publications.
ART's architecture comprises a set of core components that collaborate to execute application bytecode and native code on devices built around the Linux kernel. Key components include the interpreter, just-in-time (JIT) compiler, ahead-of-time (AOT) compiler, garbage collector, class linker, and runtime APIs that interface with the Android Framework and system services such as SurfaceFlinger and Binder (IPC) driver. The AOT compiler (historically named dex2oat) transforms Dalvik Executable (.dex) files into optimized native code that the kernel schedules on CPUs from vendors like ARM64 and x86. The class loader and verifier coordinate with security mechanisms like SELinux and code-signing enforced by Android Verified Boot. ART also exposes debugging and profiling hooks compatible with tools such as Android Studio and LLDB.
ART executes applications using a hybrid model that supports interpretation, JIT compilation, and AOT compilation stages across process lifecycle events managed by Activity (Android). The garbage collector in ART has undergone several generations—from stop-the-world mark-and-sweep designs to concurrent and low-latency collectors such as the Concurrent Copying (CC) collector and later implementations focused on pause reduction. These collectors interact with kernel-level features like cgroups and scheduler parameters provided by vendors like Qualcomm to manage memory pressure on devices with varying RAM footprints. ART's execution model ensures class initialization, method resolution, and exception handling proceed according to the Java Language Specification and interoperability requirements with native libraries compiled via the Android NDK.
ART implements multiple optimization strategies across compilation tiers: full AOT profiles produced at install time, JIT compilation guided by runtime profiling, and profile-guided AOT conversion during idle maintenance windows. Optimization passes include method inlining, register allocation tuned for ARM architecture and x86-64 microarchitectures, escape analysis, and dex-to-native transformations. Vendors such as Google and Facebook have contributed techniques for reducing application cold-start time, improving code cache reuse, and leveraging hardware features like NEON SIMD on ARM cores. The compilation pipeline integrates with build tooling like Gradle (software), and runtime profiles can be influenced by distribution mechanisms such as Google Play preloading.
ART operates within the security architecture of Android (operating system) and must enforce permissions, code integrity, and sandboxing for applications distributed through channels like Google Play Store. It cooperates with platform components including Android Runtime Permission model, Application sandbox, and low-level controls such as SELinux policies to restrict access to sensitive resources. Code signing and verification during AOT conversion interact with Android Verified Boot and package signing schemes used by developers and organisations like Mozilla or Amazon (company) when distributing apps on alternative stores. ART also implements mitigations for exploitation techniques (e.g., control-flow integrity measures and pointer authentication where supported by ARM64 hardware) and works alongside system-level features such as SafetyNet and runtime permission prompts.
Measuring ART performance involves metrics like application startup time, steady-state throughput, memory overhead, garbage collection pause times, power consumption, and binary size. Benchmark suites and tools used to evaluate ART include Android VTS, microbenchmarks in Android Studio Profiler, third-party suites from organisations such as WebKit and JetStream, and platform tests contributed by chipset vendors like Qualcomm and MediaTek. Comparative assessments may reference results on representative devices from manufacturers such as Google Pixel, Samsung Galaxy, and OnePlus to evaluate the impact of AOT vs. JIT strategies, the effectiveness of profile-guided optimizations, and trade-offs between storage usage and runtime speed.