Android Memory Optimizer (i) Dalvik virtual machines vs. Art virtual machines

Source: Internet
Author: User

1. Overview
Android4.4 to start using the art virtual machine, the Dalvik virtual machine we've been using before, then why did Google suddenly switch to Android-run virtual machines? There is only one answer: Art virtual machines are superior.

2.Dalvik vs ART
DALVIK 
Span style= "font-family:"microsoft yahei";  Font-size:14px "> Android4.4 and previously used are Dalvik virtual machine, we know that the apk in the process of packaging will be Java and other source code through Javac compiled into a. class file, but our Dalvik virtual machine will only execute. dex files, this time DX will convert. class files to Dalvik The. dex file that the virtual machine executes. The Dalvik virtual machine will first convert the. dex file into a fast-running machine code when it starts, and because of the 65535 problem, we have a package process when the cold boot is applied, and the result is that our app starts slowly, which is the JIT feature of the Dalvik virtual machine (Just In time).
ART 
Art virtual machine is an Android virtual machine that is only used in Android5.0, art virtual machines must be compatible with the features of Dalvik virtual machines, but art has a good feature AOT (ahead of time), This feature is that when we install the APK, Dex is processed directly into the machine code that can be used directly for the art virtual machine. Art virtual machines convert. dex files to directly run. Oat files, the art virtual machine natively supports multi-dex, so there is no one-pack process, so the art virtual opportunity is a big boost to the app's Cold boot speed.

3. Summary
Art Benefits:
Speed up app cold start
Boost GC Speed
Provides full-featured debug features
Art Disadvantages:
The app installs slowly because you want to build a running. oat file when the APK is installed
APK takes up a lot of space because you want to build a running. oat file when the APK is installed

Reference:

Http://liuwangshu.cn/application/performance/ram-1-dvm-art.html

Android Memory Optimization (i) Dalvik virtual machines vs. Art virtual machines

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.