Android Runtime

A comparison of Dalvik and ART architectures

Android Runtime (ART) is an application runtime environment used by the Android operating system. Replacing Dalvik, which is the process virtual machine originally used by Android, ART performs the translation of the application's bytecode into native instructions that are later executed by the device's runtime environment.[1]

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 frequently executed short segments of their bytecode into native machine code. While Dalvik interprets the rest of application's bytecode, native execution of those short bytecode segments, called "traces", provides significant performance improvements.[2][3]

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 devices. At the same time, ART brings faster execution of applications, improved memory allocation and garbage collection (GC) mechanisms, new applications debugging features, and more accurate high-level profiling of applications.[1][4][5]

To maintain backward compatibility, ART uses the same input bytecode as Dalvik, supplied through standard .dex files as part of APK files, while the .odex files are replaced with Executable and Linkable Format (ELF) executables. Once an application is compiled by using ART's on-device dex2oat 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. As a downside, ART requires additional time for the compilation when an application is installed, and applications take up slightly larger amounts of secondary storage (which is usually flash memory) to store the compiled code.[1][4][5]

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.[6][7] In the subsequent major Android release, Android 5.0 Lollipop, Dalvik was entirely replaced by ART.[8]

Android 7.0 Nougat introduced 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.[9]

See also

References

  1. 1 2 3 Andrei Frumusanu (July 1, 2014). "A Closer Look at Android RunTime (ART) in Android L". AnandTech. Retrieved July 5, 2014.
  2. Ben Cheng; Bill Buzbee (May 2010). "A JIT Compiler for Android's Dalvik VM" (PDF). android-app-developer.co.uk. Google. pp. 514. Retrieved March 18, 2015.
  3. Phil Nickinson (May 26, 2010). "Google Android developer explains more about Dalvik and the JIT in Froyo". androidcentral.com. Retrieved July 8, 2014.
  4. 1 2 "Android Developers: ART and Dalvik". source.android.com. March 9, 2015. Retrieved March 18, 2015.
  5. 1 2 "Android Developers: Configuring ART – How ART works". source.android.com. March 9, 2015. Retrieved March 18, 2015.
  6. Sean Buckley (November 6, 2013). "'ART' experiment in Android KitKat improves battery life and speeds up apps". Engadget. Retrieved July 5, 2014.
  7. Daniel P. (November 7, 2013). "Experimental Google ART runtime in Android KitKat can bring twice faster app executions". phonearena.com. Retrieved July 5, 2014.
  8. Brad Linder (October 15, 2014). "What's new in Android 5.0 Lollipop?". liliputing.com. Retrieved October 15, 2014.
  9. "Implementing ART Just-In-Time (JIT) Compiler". source.android.com. January 22, 2017. Retrieved January 22, 2017.
Wikimedia Commons has media related to Android Runtime.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.