What is DVM(Dalvik Virtual Machine)?

Dalvik Virtual Machine is a Register-Based virtual machine. It was designed and written by Dan Bornstein with contributions of other Google engineers as part of the Android mobile phone platform. The Dalvik virtual machine was named after Bornstein after the fishing village “Dalvík” in Eyjafjörður, Iceland, where some of his ancestors used to live.

What-is-DVM

Working of DVM

The Java Compiler(javac) converts the Java Source Code into Java Byte-Code(.class). Then DEX Compiler converts this (.class) file into in Dalvik Byte Code i.e. “.dex” file.

Application

For Android, a new Virtual machine was developed by Google as stated above. It uses registers of the CPU to store the operands. So no requirement of any pushing and popping of instructions. Hence making execution faster. The instructions operate on virtual registers, being those virtual registers memory positions in the host device. Register-based models are good at optimizing and running on low memory. They can store common sub-expression results which can be used again in the future. This is not possible in a Stack-based model at all. Dalvik Virtual Machine uses its own byte-code and runs “.dex”(Dalvik Executable File) file.

Advantages

  • DVM supports the Android operating system only.
  • In DVM executable is APK.
  • Execution is faster.
  • From Android 2.2 SDK Dalvik has it’s own JIT (Just In Time) compiler.
  • DVM has been designed so that a device can run multiple instances of the Virtual Machine effectively.
  • Applications are given their own instances.

Disadvantages

  • DVM supports only Android Operating System.
  • For DVM very few Re-Tools are available.
  • Requires more instructions than register machines to implement the same high-level code.
  • App Installation takes more time due to dex.
  • More internal storage is required.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.