Android Runtime
   HOME

TheInfoList



OR:

Android Runtime (ART) is an application
runtime environment In computer programming, a runtime system or runtime environment is a sub-system that exists both in the computer where a program is created, as well as in the computers where the program is intended to be run. The name comes from the compile t ...
used by the Android
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
. Replacing Dalvik, the process virtual machine originally used by Android, ART performs the
translation Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. The English language draws a terminological distinction (which does not exist in every language) between ''transla ...
of the application's
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
into native instructions that are later executed by the device's runtime environment.


Overview

Android 2.2 "Froyo" brought trace-based just-in-time (JIT) compilation into Dalvik, optimizing the execution of applications by continually profiling applications each time they run and dynamically
compiling In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
frequently executed short segments of their bytecode into native
machine code In computer programming, machine code is any low-level programming language, consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). Each instruction causes the CPU to perform a ve ...
. While Dalvik interprets the rest of application's bytecode, native execution of those short bytecode segments, called "traces", provides significant performance improvements. Unlike Dalvik, ART introduces the use of ahead-of-time (AOT) compilation by compiling entire applications into native machine code upon their installation. By eliminating Dalvik's interpretation and trace-based JIT compilation, ART improves the overall execution efficiency and reduces power consumption, which results in improved battery autonomy on
mobile device A mobile device (or handheld computer) is a computer small enough to hold and operate in the hand. Mobile devices typically have a flat LCD or OLED screen, a touchscreen interface, and digital or physical buttons. They may also have a physica ...
s. At the same time, ART brings faster execution of applications, improved
memory allocation Memory management is a form of resource management applied to computer memory. The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and free it for reuse when ...
and
garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclabl ...
(GC) mechanisms, new applications debugging features, and more accurate high-level profiling of applications. To maintain
backward compatibility Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especiall ...
, ART uses the same input bytecode as Dalvik, supplied through standard
.dex Dalvik is a discontinued process virtual machine (VM) in the Android operating system that executes applications written for Android. (Dalvik bytecode format is still used as a distribution format, but no longer at runtime in newer Android versi ...
files as part of APK files, while the .odex files are replaced with
Executable and Linkable Format In computing, the Executable and Linkable FormatTool Interface Standard (TIS) Portable Formats SpecificationVersion 1.1'' (October 1993) (ELF, formerly named Extensible Linking Format), is a common standard file format for executable files, ...
(ELF) executables. Once an application is compiled by using ART's on-device utility, it is run solely from the compiled ELF executable; as a result, ART eliminates various application execution overheads associated with Dalvik's interpretation and trace-based JIT compilation. A disadvantage of ART is that additional time is required for compilation when an application is installed, and applications take up slightly more secondary storage (usually flash memory) to store the compiled code. Android 4.4 "KitKat" brought a technology preview of ART, including it as an alternative runtime environment and keeping Dalvik as the default virtual machine. In the subsequent major Android release, Android 5.0 "Lollipop", Dalvik was entirely replaced by ART. Android 7.0 "Nougat" switched its
Java Runtime Environment Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cros ...
from the discontinued Apache Harmony to
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only w ...
, introducing a JIT compiler with code profiling to ART, which lets it constantly improve the performance of Android apps as they run. The JIT compiler complements ART's current ahead-of-time compiler and helps improve runtime performance, and save storage space by only compiling some parts of the apps. Android 9 "Pie" reduced the amount of storage used by APKs by using compressed
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
files, and profiler data can be uploaded to Google Play servers to be bundled with apps when downloaded by users with a similar device.
Android 13 Android 13 is the thirteenth major release of the Android mobile operating system, developed by Google, released for the public on August 15, 2022. History Android 13 (internally codenamed Tiramisu, after the Italian dessert) was announc ...
ART will be updated with a new garbage collector (GC) utilizing the
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, w ...
userfaultfd
system call In computing, a system call (commonly abbreviated to syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, acc ...
. It reduces memory pressure, compiled code size, jank and prevents the risk of killing apps because of low memory during GC. Other changes also improve app startup, reduce jank and improve performance. Because of the Mainline project, Android 12 ART will also be updated.


See also

*
Android software development Android software development is the process by which applications are created for devices running the Android operating system. Google states that "Android apps can be written using Kotlin, Java, and C++ languages" using the Android software d ...
various concepts and software development utilities used for the creation of Android applications *
Android version history The version history of the Android mobile operating system began with the public release of the Android beta on November 5, 2007. The first commercial version, Android 1.0, was released on September 23, 2008. Android is developed by Google in w ...
a history and descriptions of Android releases, listed primarily by their official API levels * Comparison of application virtualization software various portable and scripting language virtual machines *
Virtual machine In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized h ...
an emulation of a particular computer system, with different degrees of implemented functionality


References


External links

* * ,
XDA Developers XDA Developers (also known simply as XDA; often stylized as xda-developers) is a mobile software development community launched on 20 December 2002. Although discussion primarily revolves around Android, members also talk about many other opera ...
, February 12, 2014 * ,
Google I/O Google I/O (or simply I/O) is an annual developer conference held by Google in Mountain View, California. "I/O" stands for Input/Output, as well as the slogan "Innovation in the Open". The event's format is similar to Google Developer Day. Hi ...
2014, by Anwar Ghuloum, Brian Carlstrom and Ian Rogers * , Google I/O 2010, by Ben Cheng and Bill Buzbee
Delivering Highly Optimized Android Runtime (ART) and Web Runtime on Intel Architecture
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
, August 4, 2015, by Haitao Feng and Jonathan Ding
Android 7.1 for Developers: Profile-guided JIT/AOT compilation
Android Developers, describes ART changes in Android 7.1 {{Java Virtual Machine Android (operating system) Java virtual machine Software using the Apache license