Android Dalvik Startup Process Summary

Source: Internet
Author: User

In an Android system, the application process is hatched by the zygote process, and the zygote process is initiated by the INIT process. The zygote process creates a Dalvik virtual machine instance at startup, and whenever it hatches a new application process, it copies the Dalvik virtual machine instance into the new application process, allowing each application process to have a separate Dalvik virtual machine instance. In this article, we analyze the startup process of the Dalvik virtual machine in the zygote process.



zygote process, in addition to creating a Dalvik virtual machine instance, also loads the Java Runtime library into the process and registers some of the Android core class's JNI methods to the Dalvik virtual machine instance created earlier But, overall, is more beneficial than the disadvantage, after all, the whole system has only one zygote process, and there may be countless application processes, and we do not often go to shut down the phone, in most cases just let it go into hibernation.


This startup process is mainly accomplished by the following four things:

1. Created a Dalvik virtual machine instance;

2. The Java core class and its JNI methods are loaded;

3. Set up a JNI environment for the main thread;

4. The Jni method of the Android core class is registered.

in other words, the zygote process prepares an Dalvik virtual machine instance for the Android system, and later zygote the process to create the Android application process, It is possible to copy its own Dalvik virtual machine instance into the newly created Android application process, thus speeding up the process of the Android application process. In addition, the Java core classes and the Android core classes (in the Dex file), and their JNI methods (in the so file), are read in memory-mapped ways, so thatthezygote process, when creating an Android application process, In addition to replicating your own Dalvik virtual machine instances to the newly created Android application process, you can also share the Java core classes and Android core classes with the newly created Android application process, along with their JNI methods, thus saving memory consumption.


Pick From: http://blog.csdn.net/luoshengyang/article/details/8885792

Android Dalvik Startup Process Summary

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.