On Apr 5, 11:12 pm, Happy_Per <[email protected]> wrote:
> This question is based on the video on "Dalvik VM internal" by Dan
> Bornstein on YouTube. Dan explained clean/dirty and private/shared
> concepts.
> Under this, the memory section of zygote has been categorized as
> "shared clean"(core library dex files)  and  as "shared dirty" ( live
> dex structures").

Ah.

The optimized DEX files (either .odex on /system, or generated in /
data/dalvik-cache) are memory-mapped shared read-only.  They count as
shared/clean.

Some structures are created and populated as classes are loaded, e.g.
vtables for classes and quick lookups for previously-resolved
methods.  On the virtual heap, objects are created as the VM is
starting up, notably Class objects for every loaded class.  These are
private/dirty.

Then the zygote process calls fork(), and all of its pages are shared
copy-on-write by Linux.  So long as a child process doesn't write to
one of the pages holding vtables or Class objects, that page is shared
with the zygote.  The page doesn't exist on disk, so it's considered
shared/dirty.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en.

Reply via email to