System process Zygote (i)--Overview

Source: Internet
Author: User

Sweet spring, full of Mandarin duck pond; Farewell to the Lonely dreamland, come and I touch a fish, fold a begonia. --Xu Zhimo wake up! Awoke!

Ilocker: Focus on Android Security (new entry, 0 Basics) qq:2597294287

First look at a picture (Android boot sequence, unknown source):

The bottom of Android is Linux kernel, which is loaded by bootloader. After the kernel is started, the Init process starts first, and then the INIT process starts the other processes required by the system, including the zygote process.

The process initiated by Init is described in the "system\core\rootdir\root.rc" script:

Look again at zygote.rc (take init.zygote32.rc as an example):

This script requires the INIT process to create a process called zygote, which executes the program "/system/bin/app_process". and create a socket resource for the zygote process (for interprocess communication, Activitymanagerservice is the zygote process fork an application process through the socket request).

The zygote process starts the virtual machine when it initializes and loads some system resources. In this way Zygote fork out of the child process, the child process also inherits the work of the virtual machine and various system resources, then just load the APK file bytecode can run the application, can greatly shorten the application startup time, which is the main role of the zygote process.

Java applications cannot run directly in the form of a local process and must run in a separate virtual machine. If you restart the virtual machine each time, the startup speed of the application is severely slowed.

The Linux process is forked, and the child processes that fork out share the memory image with the parent process. Only when a child process overwrites memory does the operating system assign a new page to it and copy the data on the old page to a new page, which is "copy on write".

Learning materials: (1) http://blog.csdn.net/luoshengyang/article/details/6768304 (2) "Android Framework Revelation" (3) "Deep analysis Android 5.0 system"

System process Zygote (i)--Overview

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.