Different applications in different process space to run, combined with the application of different sources are using a different user to run Linux, you can apply the greatest degree of protection of security and independence of operation.
Zygote is a virtual machine process, but also an incubator for virtual machine instance, whenever the system requirements for the implementation of an Android application, Zygote would FORK a child process to execute the application. Benefits of doing so is obvious: Zygote process is generated when the system starts, it will complete the initialization of the virtual machine, library loading, the preset library loading and initialization, etc. operations, while in the system needs a new virtual machine instance, Zygote by copying itself, the fastest delivery of systems. In addition, for some read-only system libraries, all virtual machine instances, and Zygote share a memory region, considerable savings in memory overhead.
本文详细阐述了每一个Android应用程序都在Dalvik虚拟机实例中运行,每个虚拟机实例都拥有独立的进程空间。虚拟机线程机制、内存分配与管理、互斥等依赖底层操作系统实现。应用线程对应于Linux线程,虚拟机因此可能更依赖操作系统的线程调度与管理机制。不同应用在不同的进程空间内运行,结合不同来源的应用使用不同的用户运行Linux,能实现最大程度的安全保护与操作独立性。Zygote作为虚拟机进程同时也是虚拟机实例的孵化器,在系统需求执行Android应用时,会fork一个子进程来执行应用。这样做明显的优势在于,当系统启动时,Zygote进程会被创建并完成虚拟机初始化、库加载等操作,而在系统需要新的虚拟机实例时,Zygote通过复制自身快速提供系统。此外,对于只读系统库,所有虚拟机实例和Zygote共享一个内存区域,从而节省了大量内存开销。
644

被折叠的 条评论
为什么被折叠?



