每个活动或应用程序DVM实例创建应用程序、实例、DVM

2023-09-07 03:42:33 作者:感情流浪汉

有关Android的,每个应用程序都有自己的DVM的实例或应用程序的每个活动都有即DVM的实例是基于应用程序或活动?

For Android, each application has its own instance of DVM or each activity of an application has its own DVM instance i.e. the instance of DVM is created based on the application or activity?

推荐答案

一般来说,每个进程都有自己的Dalvik虚拟机。由于通常每一个应用程序在一个进程中运行,所有活动共享Dalvik虚拟机这一进程。

Generally, each process has its own Dalvik VM. Since normally each application runs in a single process, all activities share the Dalvik VM for that process.

有更复杂的情况下(到N个过程的一个应用程序小号$ P $垫,N Google Apps共享一个进程),但这些都是传统的Andr​​oid应用程序的开发非常不寻常的。

There are more complicated scenarios (one app spread across N processes, N apps sharing one process), but those are very unusual in conventional Android application development.