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
- 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.
- 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
- 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)