Thursday, December 15, 2011

DVM vs JVM


1.    Dalvik is the process virtual machine (VM) in Google's Android operating system. It is the software that runs the apps on Android devices.
2.    Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones and tablet computers. Programs are commonly written in a dialect of Java and compiled to bytecode. Then they are converted from Java Virtual Machine-compatible .class files to Dalvik-compatible .dex (Dalvik Executable) files before installation on a device.
3.    The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed.
4.    Dalvik is open-source software. It was originally written by Dan Bornstein, who named it after the fishing village of Dalvík in EyjafjörðurIceland, where some of his ancestors lived.
5.    A tool called dx is used to convert some (but not all) Java .class files into the .dex format. Multiple classes are included in a single .dex file.
6.      DVM is Register based which is designed to run on low memory, uses its own byte code and runs .Dex file .
7.    From Android 2.2 SDK Dalvik has got a Just in Time compiler
8.    JVM is Stack based which uses java byte code and runs .class file having JIT.
JVM vs DVM

DVM
          JVM
Architecture
Register
Stack
OS Support
Android
Multiple
Re- Tools
few
many
Executables
APK
JAR
Constant-Pool
Per Application
Per class
Memory
Less
More


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