Working principle of Dalvik Virtual Machine

Source: Internet
Author: User

Dalvik virtual machines do not use popular virtual machine technologies such as JIT. However, according to Google's report, the lack of this function does not cause performance loss for Dalvik virtual machines. We also believe that the performance of the Dalvik virtual machine can be further improved.

According to Google's calculations, 64 m RAM has been able to make the system operate normally. Among them, 24 m is used for initialization and startup of the underlying system, and 20 m is used for high-level startup of high-level services. Of course, with the increase of system services and the expansion of application functions, the memory consumed by Dalvik will inevitably increase. In summary, the Dalvik virtual machine has the following main features:

DEX is a file format dedicated to Dalvik virtual machines. Why does it use a new format instead of an existing CLASS file? Many classes are defined in an application. After compilation, there will be a lot of corresponding CLASS files, and there will be a lot of redundant information between CLASS files;

The DEX file format integrates all the CLASS files into one file. In this way, in addition to reducing the overall file size, I/O operations also increase the speed of searching classes. The original constant pool in each class file is managed by a constant pool in the DEX file. The specific method is as follows:

The support for new operation codes should be as concise as possible, and long commands should be used to increase the resolution speed and expand the size of the read-only structure as much as possible, to improve cross-process data sharing, how does one generate DEX files? The Android system and the Dalvik Virtual Machine provide the tool DX). After compiling the Java source code into a CLASS file, the DX tool is used.

Related Article

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.