Android Dalvik Virtual Machine and ART virtual machine comparison, androiddalvik

Source: Internet
Author: User

Android Dalvik Virtual Machine and ART virtual machine comparison, androiddalvik

1. Overview
Android 4.4 and later started to use the ART virtual machine. Before that, we used the Dalvik Virtual Machine. Why did Google suddenly change to the virtual machine running Android? There is only one answer: the ART virtual machine is better.

2. Dalvik vs ART
Dalvik
Android4.4 and previously used Dalvik virtual machines. We know that the Apk will first compile the java and other source code through javac during packaging. class file, but our Dalvik virtual machine will only execute. dex file. At this time, dx will. the class file is converted to the Dalvik Virtual Machine for execution. dex file. When the Dalvik virtual machine is started. the dex file is converted to a fast-running machine code. Due to the 65535 issue, we had a package-breaking process during cold start of the application. The final result is that our app was slow to start, this is the JIT feature (Just In Time) of the Dalvik virtual machine ).
ART
The ART virtual machine is an Android virtual machine that is used only in Android5.0. The ART virtual machine must be compatible with the features of the Dalvik Virtual Machine. However, ART has a good AOT (ahead of time) feature ), this feature enables us to directly process dex into a machine code that can be directly used by the ART virtual machine when installing the APK. dex files can be converted to directly run. in oat files, the ART virtual machine supports multiple dex files, so there will be no package combination process. Therefore, the ART virtual machine greatly improves the cold start speed of the APP.

3. Summary
Advantages of ART:
Accelerate cold start of apps
Increase GC speed
Provides fully functional Debug Features
Disadvantages of ART:
Slow APP installation because the. oat file can be generated during APK Installation
The APK occupies a large amount of space, because the. oat file can be generated during APK installation.

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.