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