android application,Dalvik virtual machine和进程关系

本文详细阐述了每一个Android应用程序都在Dalvik虚拟机实例中运行,每个虚拟机实例都拥有独立的进程空间。虚拟机线程机制、内存分配与管理、互斥等依赖底层操作系统实现。应用线程对应于Linux线程,虚拟机因此可能更依赖操作系统的线程调度与管理机制。不同应用在不同的进程空间内运行,结合不同来源的应用使用不同的用户运行Linux,能实现最大程度的安全保护与操作独立性。Zygote作为虚拟机进程同时也是虚拟机实例的孵化器,在系统需求执行Android应用时,会fork一个子进程来执行应用。这样做明显的优势在于,当系统启动时,Zygote进程会被创建并完成虚拟机初始化、库加载等操作,而在系统需要新的虚拟机实例时,Zygote通过复制自身快速提供系统。此外,对于只读系统库,所有虚拟机实例和Zygote共享一个内存区域,从而节省了大量内存开销。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

              Every Android application runs in a Dalvik virtual machine instances where each instance of a virtual machine is a separate process space. Virtual machine thread mechanism, memory allocation and management, Mutex, etc. are all dependent on the underlying operating system and achieve. All Android application thread corresponds to a Linux thread, the virtual machine and thus can be more dependent on the operating system thread scheduling and management mechanism.

        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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值