androiddalvik

Understanding Android: Zygote and DalvikVM


I am trying to understand how Android launches applications. The question is how (and why) does the Zygote fork a new Dalvik VM? I do not understand why it is not possible to run multiple applications in the same Dalvik VM.


Solution

  • No. Dalvik doesn't span processes.

    However, the Binder IPC mechanism can do a very convincing job of making objects appear to migrate to a different process and its Dalvik instance. Also, the memory management is very good about sharing read-only pages across all processes that need them. The Dalvik process hosting a typical app is forked off of zygote with all the common android libraries already mapped, so new unique copies don't have to be opened.

    Source: Do apps using multiple processes share a Dalvik instance?

    Also check these links:

    http://davidehringer.com/software/android/The_Dalvik_Virtual_Machine.pdf

    http://commonsware.com/blog/Articles/what-is-dalvik.html