The Wayback Machine - https://web.archive.org/web/20240619235439/https://www.geeksforgeeks.org/difference-between-jvm-and-dvm/
Open In App

Difference Between JVM and DVM

Last Updated : 29 Dec, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

JVM is the virtual machine that runs java code on different platforms. It acts as an abstract layer between the program and the platform on which the java code is running. The portability of Java code is possible only because of the JVM. The javac compiler converts the source code file(.java file) into an intermediate java bytecode format which is machine/platform independent. This intermediate file is then provided to the target machine/platform where it gets translated into machine code. JVM supports multiple host architecture and it is the reason why Java applications are called WORA(Write Once Run Anywhere).

JVM(Java Virtual Machine)

DVM(Dalvik Virtual Machine)

DVM is a virtual machine to execute Android applications. The Java bytecode(.class file) generated by javac compiler is converted into Dalvik bytecode to make the application source files executable on the DVM. Since Android devices have a definite processing capacity, memory, and battery life, the DVM design principle aims to optimize itself so that it can load fastly and run smoothly even on low memory/powered devices. This virtual machine is very efficient in running multiple instances on the same device.

DVM(Dalvik Virtual Machine)

Difference Table

JVM(Java Virtual Machine)

DVM(Dalvik Virtual Machine)

Stack-based VM that performs arithmetic and logic operations through push and pop operands. The result of operations is stored in stack memory. Register-based VM that uses registers located in the CPU to perform arithmetic and logic operations.
Java source code is compiled into Java bytecode format(.class file) that further translates into machine code. Source code files are first of all compiled into Java bytecode format like JVM. Further, the DEX compiler(dx tool) converts the Java bytecode into Dalvik bytecode(classes.dex) file that will be used to create the .apk file.
More information is required to the VM for data loading and manipulation as well as method loading in the stack data structure. Instruction size is larger as it needs to encode the source and destination register of the VM.
Compiled bytecode size is compact because the location of the operand is implicitly on the operand stack. Compiled bytecode size is larger as each instruction needs all implicit operands.
The executable file for the device is .jar file. The executable file for the device is .apk file.
A single instance of JVM is configured with shared processes and memory space in order to run all deployed applications. The device runs multiple DVM instances with a separate process in shared memory space to deploy the code of each application. 
Supports multiple operating systems like Linux, Windows, and Mac OS. Support only the Android operation system.

Note: Google introduced a new Virtual machine for android applications in 2014 which is known as Android Runtime(ART). It is designed with the purpose to improve application performance and reduce device battery usage. The last supported version for the DVM was Android 4.4(Kitkat).


Similar Reads

How JVM Works - JVM Architecture?
JVM(Java Virtual Machine) acts as a run-time engine to run Java applications. JVM is the one that actually calls the main method present in a Java code. JVM is a part of JRE(Java Runtime Environment). Java applications are called WORA (Write Once Run Anywhere). This means a programmer can develop Java code on one system and can expect it to run on
7 min read
Difference between JIT and JVM in Java
Java Virtual Machine (JVM) is used in the java runtime environment(JRE). The original JVM was conceived as a bytecode interpreter. This may come as a bit of a surprise because of performance problems. Many modern languages are meant to be compiled into CPU-specific, executable code. The fact that the JVM executes a Java program, however, helps addr
4 min read
Difference Between 32-bit and 64-bit JVM in Java
One does not need to know the difference unless developing a performance-critical application. The minor distinction between 32-bit and 64-bit JVMs would make little difference in your application. Now coming onto the differences where we will be listing out some key differences between 32-bit and 64-bit Java Virtual Machines are listed below in wh
4 min read
Differences between JDK, JRE and JVM
Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools needed in Java development. Now we need an environment to make a
5 min read
Verification in Java (JVM)
After the class loader in the JVM loads the byte code of .class file to the machine the Bytecode is first checked for validity by the verifier and this process is called as verification. The verifier performs as much checking as possible at the Linking so that expensive operation performed by the interpreter at the run time can be eliminated. It en
3 min read
Java Virtual Machine (JVM) Stack Area
For every thread, JVM creates a separate stack at the time of thread creation. The memory for a Java Virtual Machine stack does not need to be contiguous. The Java virtual machine only performs two operations directly on Java stacks: it pushes and pops frames. And stack for a particular thread may be termed as Run – Time Stack. Every method call pe
4 min read
Types of JVM Garbage Collectors in Java with implementation details
prerequisites: Garbage Collection, Mark and Sweep algorithm Garbage Collection: Garbage collection aka GC is one of the most important features of Java. Garbage collection is the mechanism used in Java to de-allocate unused memory, which is nothing but clear the space consumed by unused objects. To deallocate unused memory, Garbage collector track
5 min read
How to Generate JVM Heap Memory Dump?
Java Heap dump is a snapshot of all java objects that are present in the JVM(Java Virtual Machine) at a certain point in time. The JVM allocates memory for objects which are class instances or arrays in the heap memory. When the objects are no longer needed or are no more referenced, the Garbage Collector runs and reclaims the memory space occupied
7 min read
Frequently Used JVM Parameters
A JVM or Java Virtual Machine is a software implementation of a physical machine, or we can say it is an abstract machine. Java was designed with the concept of WORA (Write Once Run Anywhere), which runs on a VM. It is a specification that gives a runtime environment during which java bytecode is often executed. The compiler compiles the Java file
3 min read
Java Program to Check if JVM is 32 or 64 bit
JVM Stands for Java Virtual Machine. It is an abstract computing machine that allows a computer to run a Java program. It is a platform-independent environment, responsible for compiling Java programs by performing conversion of Java code into machine language i.e. byte code. The memory needed by JVM to run a Java program is called heap memory. In
2 min read