2015-09-14 249 views
1

adb shell stopadb shell busybox pkill zygote之後,我注意到所有的android應用程序進程如com.android.email都消失了,它是如何完成的?當zygote死亡時,android如何殺死app進程?

+0

你是什麼意思? Zygote是所有應用程序流程的母公司。它從字面上運行所有應用程序,這也是Zygote傾向於在大多數堆棧跟蹤中出現的原因。如果你殺了Zygote,那麼所有的應用程序進程都會死掉。 –

+0

如果你在Google上閱讀Zygote的時間超過5秒,你會自己想象出來。 –

回答

-1

adb shell busybox ps -o pid,ppid,pgid,comm顯示所有應用進程屬於同一個進程組,並且組長爲zygote,這就是爲什麼pkill zygote會終止所有應用進程。

dex2oat boot.oat也從zygote分叉但不屬於zygote進程組。如果您幾次清除dalvik-cache和adb shell stop; adb shell start,則會看到多個併發運行的dex2oat進程,這會導致OOM錯誤。