What data is in dalvik-LinearAlloc, dalvik-aux-structure, dalvik-bitmap-1, dalvik-bitmap-2, dalvik-card-table, dalvik-mark-stack and dalvik-zygote?

I use the showmap command on the PID, and I cannot understand this part in the report:

16384 3752 689 0 3132 0 620 4 /dev/ashmem/dalvik-LinearAlloc (deleted) 2460 1748 934 0 828 0 920 18 /dev/ashmem/dalvik-aux-structure (deleted) 8192 572 572 0 0 0 572 1 /dev/ashmem/dalvik-bitmap-1 (deleted) 8192 0 0 0 0 0 0 1 /dev/ashmem/dalvik-bitmap-2 (deleted) 4100 312 312 0 0 0 312 1 /dev/ashmem/dalvik-card-table (deleted) 502140 14860 14860 0 0 0 14860 3 /dev/ashmem/dalvik-heap (deleted) 1500 280 280 0 0 0 280 1 /dev/ashmem/dalvik-jit-code-cache (deleted) 174764 0 0 0 0 0 0 1 /dev/ashmem/dalvik-mark-stack (deleted) 22148 22148 2141 0 20452 0 1696 1 /dev/ashmem/dalvik-zygote (deleted) 

I want to know what data is in dalvik-LinearAlloc, dalvik-aux-structure, dalvik-bitmap-1, dalvik-bitmap-2, dalvik-card-table, dalvik-mark-stack and dalvik-zygote.

These ashmem are worth millions of bytes of memory, and I want to find a measure to reduce the size of these ashtrays.

+6
source share
1 answer

showmap downloads break data from a single process. smap describes detailed information about the process's memory area. In a virtual memory management system, memory can get a system API such as mmap, brk. After receiving the virtual memory address by these APIs, the address and length will be written to smap.

And let each section of dalvik relative memory list:

  • Dalvik Heap Section (Heap Management, GC)
    • dalvik-bitmap-1, dalvik-bitmap-2 is the Dalvik storage management data structure. The Dalvik GC is marksweep, and 8-bit memory will be marked (used or free) as one bit in the bitmap. These two bitmaps will be used as the active map (used for marking @runtime), and the other will be used as the designated map (@GC time used).
    • dalvik-mark-stack: to use the GC mark step. The mark step will iterate over the bitmap, so this is the first width search, which will require a stack.
    • dalvik-card-table: used for parallel Dalvik GC, in raster marking methods, the process will perform other tasks that will lead to memory usage. These card tables record contaminated memory after the first marking step. You can see the details by searching for the GC tag label.
    • dalvik-heap is used to use process memory
    • dalvik-zygote is the part of the heap of holes that @GC will not use. All processes will share these memories, such as environmental resources.
  • dalvik-jit is the jit memory used by Dalvik. JIT: just in time, which converts the dex bytecode into machine code that can be executed by the processor.
  • dalvik-LinearAlloc: this is dalvik permanent memory, such as: method, class definition data, thread stack threads. This memory can be set READONLY after parsing the class definition.
  • dalvik-aux-structure: auxiliary data structures that will compress the const method / class / string reference. These links will be used @ each dex file, but the sum of this memory will cost a lot of memory. Therefore, Dalvik creates tmp memory for sharing these links.

If you want to analyze your program memory, I suggest you use MAT in eclipse. And using the native heap, you can use mmap to control.

+9
source

All Articles