andriod--differences between DVM and JVM (2)

Source: Internet
Author: User

Distinguishing between DVM and JVM

1. Top Differences

Dalvik: Register-based, compile and run faster

JVM: Stack-based, compile and run slower

2. Byte-code differences

Dalvik: Executes. DEX-formatted bytecode, which is generated when the. class file is compressed and the file becomes smaller

JVM: Execution of byte codes in. class format

3. Differences in the operating environment

Dalvik: An app launch runs a separate virtual machine running in a separate process

JVM: Only one instance can be run, that is, all applications run in the same JVM

The difference between a JVM and a DVM
    1. dvm is the abbreviation for Dalvik virtual machine, is an abbreviation for an Android virtual machine (why not Call Avm-android virtual machine?). The reason for this is that the author was named after his ancestral village called Dalvik.
    2. dvm JVM ( java virtual machine, because JVM oracle Company ( original Sun company) products, concerned about copyright issues, since Java is open source, simply studied JVM and wrote the Span style= "FONT-FAMILY:CALIBRI;" >DVM
    3. jvm and DVM " Span style= "font-family: the song Body;" The main differences are as follows:

A) execution of the direct code file is not the same

Java

. jar files with. java file. class file

Android

. java files –>. dex files

As shown, the. jar file contains more than one. Classfile, each. ClassfileIt contains header information for the class (such as compiled version), Chang, class information, domain, method, attributes, and so on, when the JVMLoad the. jarfile, it loads all of the. classfile, which is very slow, and the memory of the mobile device is very small, it can't be likeJVMthis loads,So it's not using a. jarfiles,instead. apkfile, the file contains only one. dexfile, this. DexfileInside will all the. ClassinsideThe information contained is all integrated so that it can be loaded quickly.. ClassThe file has a lot of redundant information,Dextool removes redundant information and puts all. Classfile integration into. Dexfile. Reduced theI/Ooperation, which improves the search speed of the class.Nanjing BowenJavaAndroid class fight Sign up!

b) based on a different architecture

Java Stack- based architecture. Stack is a contiguous amount of storage space above the memory

Android Register-based architecture. Register is a piece of storage space above the CPU

So, the CPU directly accesses the data above the piece of space above itself is certainly more efficient than accessing the data above the memory

andriod--differences between DVM and JVM (2)

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.