andriod--difference between DVM and JVM

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, which is the abbreviation for the Android virtual machine (why not call avm-android Where's  virtual machine? The reason for this is that the author was named after his ancestral village called Dalvik.
    2. dvm is for jvmJVM< Span style= "font-family: the song Body;" > is oracle Company (formerly Sun Company's products, worried about copyright issues, since Java is open source, simply study jvmDVM
    3. jvmdvm

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. ClassFiles, each. classThe file contains header information (such as compiled version) of the class, Chang, class information, domain, method, attributes, and so on, when the JVMLoad the. jarfile, it loads all of the. classFiles, which can be very slow, and the memory of the mobile device is very small, it is not asjvm so loaded, so it's not using the. jar file, instead. Apk file, this. Dex The file contains all the. class .class There's a lot of redundancy in the file, dex tool removes redundant information and puts all .class file integration into .dex file. Reduced i/o operation, which improves the search speed of classes. Android class Fight registration!

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--difference between DVM and 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.