Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the relationship between Dalvik and Zygote process?

Tags:

android

dalvik

I just want to know :

  • Who created the dalvik_Vm ?

  • Is the zygote process running in the vm or contrary?

like image 455
Zhang Xiang Avatar asked Oct 19 '16 05:10

Zhang Xiang


2 Answers

Dalvik VM was authored by Dan Bornstein
Every android application runs in a separate process, has its own Dalvik VM.

Zygote is a daemon with the only mission to launch applications. This means that Zygote is the parent of all App process. When app_process launches Zygote, it creates the first Dalvik VM and calls Zygote’s main () method. Once Zygote starts, it preloads all necessary Java classes and resources, starts System Server and opens a socket /dev/socket/zygote to listen for requests for starting applications.

like image 100
CodeWalker Avatar answered Sep 27 '22 21:09

CodeWalker


Add some example to explain that Zygote is the parent of all App process. zygote PID : 481, my application processes PPID : 481, you can use ps command to check.

UID            PID  PPID C STIME TTY          TIME CMD
root           481     1 0 09:17:54 ?     00:00:03 zygote
u0_a132      28993   481 78 09:07:53 ?    00:23:46 com.languouang.helloworld
u0_a132      29013   481 0 09:07:53 ?     00:00:01 com.languouang.helloworld:countservice
u0_a132      29296   481 1 09:09:04 ?     00:00:09 com.languouang.helloworld:mall
u0_a132      30427   481 1 09:16:42 ?     00:00:15 com.languouang.helloworld:faq
like image 24
Languoguang Avatar answered Sep 27 '22 21:09

Languoguang