|What's the data in dalvik-LinearAlloc, dalvik-aux-structure, dalvik-bitmap-1, dalvik-bitmap-2, dalvik-card-table, dalvik-mark-stack and dalvik-zygote?|
showmap is dumpping the smap data from one process. The
smap is describing the process's memory area's detail. In
virtual memory manage system, the memory can be gained by the system API
such as mmap, brk. After gaining virtual memory address
by these APIs, the address and length will be recorded in
And let's list each section of the dalvik relative memory usage:
- Dalvik Heap section(Heap Management, GC)
- dalvik-bitmap-1, dalvik-bitmap-2 is the Dalvik Heap management
data stucture. In Dalvik, the GC is marksweep, and 8 bytes memory
will be marked(Used or free) as one bit in the bitmap. These two bitmaps
will be used as active map(used for marking @ runtime) and the other will
be used as marked map(used @ GC time).
- dalvik-mark-stack: For GC mark step use. The mark step will iterate the
bitmap, so this is a Breadth-first search which will need a stack.
- dalvik-card-table: is used for Dalvik Concurrent GC, in bitmap
marking steps, the process will do other tasks which will lead using
memory. These card tables is recording the memory dirty after first marking
step. You can see the detail by searching mark sweep GC.
- dalvik-heap is used for process memory usage
- dalvik-zygote is one part of the hole heap, which will not be used @
GC. All processes will share these memories such as framework
- dalvik-jit is The jit memory used in Dalvik. JIT: just in
time, which will convert dex bytecode to machine code which can be executed
- dalvik-LinearAlloc: is the dalvik's perm memory such as: Method, Class
definition datas, thread stack datas. These memory can be setted
READONLY after parsing the class definition.
- dalvik-aux-structure: auxillary data structures, which will compress
the method/class/string const reference. These references will be used @
each dex file, but sum of these memory will cost a large memory. So Dalvik
create a tmp memory to shared these references.
If you want to analysis your program's memory, I suggest you to use MAT
in eclipse. And the native heap usage, you can use mmap to manage.