The art and Dalvik comparison and the principles of virtual machines

Source: Internet
Author: User
Tags garbage collection

Art (Andriod Runtime) is the next version of the Dalvik virtual machine, Dalvik runs bytecode, and art runs local code, and the virtual machine is used to run the system's application.

the advantages of art compared to Dalvik:

1. Lead compilation: Mainly used to increase speed and reduce memory overhead, and Dalvik is compiled by JIT (just in time) that is: No inventory mode of production, every run program needs to recompile, which not only increases the burden of memory, but also slower, and art and JIT similar, But art runs only once, and it runs once when the program is installed (the code that compiles the cost of our app), so the first time you start art will be slower than Dalvik, and then it will be much faster than Dalvik.

2. Improves the performance of garbage collection.

the principle of virtual machines:

First, let's look at the Java Virtual machine running process, when you write the Java code after the input instructions: Javac Yourclassname.java, then your Java code is compiled into bytecode, of course, if you are using the Eclipse IDE, Android Studio and other development tools, you save the code when the development work automatically to help you do the above work, you can see the directory below the Java file corresponding to the class file, and then the JRE (Java Runtime Environment) The loader loads the class file from the hard disk, loads it into the memory area of the JVM (running the data area of-runtime. Areas), and finally loads the engine or compiles the class file into a specific CPU machine code, the CPU runs the mechanical code, So the whole process is done.

Class Loader (Introduction):

The ClassLoader is organized into a hierarchical relationship, that is, the parent-child relationship, where Bootstrap is the class loader, at the top.




    




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.