What is the difference between a Dalvik VM (DVM) and a Java VM (JVM)?

Source: Internet
Author: User

The Dalvik virtual machine exists in the Android system, the JVM is a Java virtual machine, both are virtual machines, this article compares the two, tell them the difference.

Dalvik virtual Machine is one of the core components of Android mobile device platform developed by Google and other manufacturers. It can support the operation of a Java application that has been converted to. Dex (that is, Dalvik executable) format, which is a compression format designed for Dalvik and is suitable for systems with limited memory and processor speed. (DX is a set of tools that convert Java. class to. dex format.) A DEX file usually has more than one. Class. Because Dex sometimes has to be optimized, it increases the file size by 1-4 times, ending with Odex. )

1. The primary difference between the Dalvik and the standard Java virtual machine (JVM)

The Dalvik is based on a register, and the JVM is stack-based. Register-based virtual machines for larger programs, it takes less time to compile.

2. The difference between Dalvik and Java bytecode

The Dalvik executes. DEX-formatted bytecode, while the JVM executes the. Class byte-code.

3. The SDK for Dalvik and Java SDK is different.

4. The difference between Dalvik and Java operating environment   

Dalvik is optimized to allow instances of multiple virtual machines to run concurrently in limited memory, and each Dalvik application executes as a standalone Linux process. A standalone process can prevent all programs from shutting down when the virtual machine crashes.

The Dalvik virtual machine uses JIT (just-in-time) technology after android2.2, and is not exactly the same as the JIT of a traditional JVM.

The Dalvik virtual machine has its own bytecode and is not using Java bytecode.

The following points are also available:

1, Dalvik is mainly the completion of object lifecycle management, stack management, thread management, security and exception management, as well as garbage collection and other important functions.

2, Dalvik responsible for process isolation and thread management, each Android application in the bottom will be corresponding to a separate Dalvik virtual machine instance, its code in the virtual machine interpretation to execute.

3. Unlike Java virtual machines running Java bytecode, the Dalvik virtual machine runs its proprietary file format, Dex.

4. dex file format can reduce the overall file size and improve the class lookup speed of I/O operations.

5, Odex is in order to further improve performance during operation, the further optimization of Dex files.

6, all the android application threads are corresponding to a Linux thread, the virtual machine can therefore rely more on the operating system thread scheduling and management mechanism.

7, there is a special virtual machine process zygote, he is a virtual machine instance of the incubator. It will be generated when the system starts, it will complete the initialization of the virtual machine, library loading, prefabricated class library and initialization operations. If the system needs a new instance of the virtual machine, it will quickly replicate itself and provide the system with the fastest speed. For some read-only system libraries, all virtual machine instances share a memory area with zygote.

What is the difference between a Dalvik VM (DVM) and a Java VM (JVM)?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.