使用 VMMap 查看进程地址空间分配
VMMap is a
process virtual and physical memory
analysis utility.
It shows abreakdown
of aprocess's committed virtual memory types
as well as theamount of physical memory (working set)
assigned by the operating system to those types.
整体分析
分析的是 windows10 上的一个 git bash
进程。
进程的栈区
image
在 windows 上是 .exe
或者 .dll
文件。
bash 程序的程序逻辑划分
heap 区域
free 空闲的虚拟地址空间
从上图可知
free
的虚拟地址空间,被分成了32
个 block。怎样管理这写 block 呢?可以用一个 free-list 的数据结构来管理。至于一个分配虚拟内存的需求,应该怎样满足,那方法可就多了。什么 first fit、best fit 等等。