Sunday, 7 October 2012

What is Dalvik Virtual Machine?

Dalvik is an Open Source Software originally written by Dan Bornstein who named it after the fishing village of Dalvik in Iceland.

Dalvik Virtual Mahcine is a process virtual machine (VM) in Android Operating System. It is a software that runs the applications on Android Devices. Dalvik is used primarily in smartphones and tablets but recently it is also being used in smart Tvs and media streamers.

Programs are written in Java and compiled to java bytecode. They are then converted from Java Virtual Machine .class files to Dalvik compatible .dex (Dalvik Executable)files. The compatc Dalvik Executable format is suitable for systems that are constrained in terms of memory and processor speed.

Salient Features of Dalvik VM

  • Dalvik VM uses a register based architecture instead of stack based architecture used by Java Virtual Machine.
  • VM is trimmed down to limit memory space requirement.
  • The constant pool has been modified to use only 32-bit indices to simplify the interpreter
  • Standard Java bytecode executes 8-bit stack instructions. Local variables must be copied to or from the operand stack by separate instructions. Dalvik instead uses its own 16-bit instruction set that works directly on local variables. The local variable is commonly picked by a 4-bit 'virtual register' field. This lowers Dalvik's instruction count and raises its interpreter speed.
  • Dalvik has the capacity to compress resources that you have in your application there by reducing the final apk size and makes the device run multiple instances of the VM efficiently
Difference between Dalvik VM and Java VM

                                            Dalvik                               JVM
Architecture                          Register                            Stack
OS Support                          Android                            Many
Executables                          APK                                 JAR
Constant Pool                       Per Application                 Per Class
Memory Reqt                       Low                                  High

Licenses

Dalvik is said to be a clean-room implementation rather than a development on top of a standard Java runtime, which would mean it does not inherit copyright-based license restrictions from either the standard-edition or open-source-edition Java runtimes. Dalvik is published under the Apache 2 license.
(Source: wikipedia)



No comments:

Post a Comment