Dalvik virtual machine
From Wikipedia, the free encyclopedia
The Dalvik virtual machine is a register-based virtual machine, designed and written by Dan Bornstein with contributions from other Google engineers as part of the Android mobile phone platform.[1]
It is optimized for low memory requirements, and is designed to allow multiple VM instances to run at once, relying on the underlying operating system for process isolation, memory management and threading support. Dalvik is often referred to as a Java Virtual Machine, but this is not strictly accurate, as the bytecode on which it operates is not Java bytecode. Instead, a tool named dx, included in the Android SDK, transforms the Java Class files of Java classes compiled by a regular Java compiler into another class file format (the .dex format).[2]
The Dalvik virtual machine was named by Bornstein after the fishing village of Dalvík in Eyjafjörður, Iceland, where some of his ancestors lived.[3][4]
[edit] Architecture
Being optimized for low memory requirements, Dalvik has some specific characteristics that differentiate it from other standard JVMs[5]:
- The Java Virtual Machine used for Dalvik was slimmed down to use less space. The underlying C standard library was rewritten, and the JVM C++ implementation has no support for Exception handling,
- The Dalvik JVM has no Just-in-time compiler,
- The JVM constant pool has been modified to use only 32-bit indexes to simplify the interpreter.
However, although the modified .dex format allows for a simpler architecture, it is more constrained. It can not perform and would not allow easily to run Dynamic programming language on the JVM, or even JIT compilation.
Dalvik uses Apache Harmony (which is under the Apache License) instead of OpenJDK (which is under the GPL + linking exception) to allow cell phone makers to modify the core JVM without having to distribute their code.
[edit] References
- ^ What is Android?. code.google.com. Retrieved on 2008-02-05.
- ^ What is Android?: Android Runtime. Google (2007-11-12). Retrieved on 2007-11-13. “The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool.”
- ^ Journal entry
- ^ Google Calling: Inside Android, the gPhone SDK. onlamp.com. Retrieved on 2008-02-05.
- ^ Rose, John (2008-05-31). with Android and Dalvik at Google I/O. Retrieved on 2008-06-08.