|
1. cat / proc / meminfo that memory status
2. The allocation shall then write assignment, not yet assigned when malloc, strcpy or other operations
3. cat / proc / / statm that process memory page status
#cat / proc / 6277 / statm
6,020,225,316,027,804,580
Virtual physical memory pages shared virtual memory size of the executable is mapped to the task of virtual memory space the size of the library program data and user mode stack segment size
4. cat / proc / / maps look at each address corresponding to the file / dynamic library (snippet - read-only executable stack segment - can read and write, stack segment - grew up to 0xC00000000)
5. cat / proc / / memmaps (cat / proc / / smaps) See corresponding physical memory virtual memory status
Before ptr 4-byte chunk structure 6. malloc Department obtained, including the former block size, the size of their own, flag
7. flag on a bit concerned about being used or not, or whether the allocation by mmap
8. malloc allocates at least one 16-byte, 8-byte aligned, then 20 bytes allocated will be 24 bytes
9. glibc, the management within the 1G space by brk responsible for more than 1G responsible manner by mmap
10. small memory will not try to merge
11. The definition of small blocks of memory may be #include int mallopt (int param, int value) defined
12. param value is usually M_MXFAST, defaults to 64 |
|
|
|