今天分析一个dmp文件时,想看下内存的使用情况,于是执行!address -summary,结果却有如下输出:

0:000> !address -summary
The current target does not provide full memory information. No meaningful summary available.
Use !address with no arguments to display the available virtual memory map of the target.

之前收集到的dmp文件没有这样问题,于是问了下支持的同事,这个dmp文件的获取方法是怎样的。支持的同事反应不是自己抓的,是我们的程序自动产生的。看来程序在生成dmp时,Minidump的的选项设置有问题。

用工具打开dmp看看

 

赶紧查看一下代码

 

果然设置选项不够,赶紧加上MiniDumpWithFullMemoryInfo选项,制造一个异常,在看看

 

 

用Windbg加载,并执行!address -summary

0:000> !address -summary

                                     
Mapping file section regions...
Mapping module regions...
Mapping PEB regions...
Mapping TEB and stack regions...
Mapping heap regions...
Mapping page heap regions...
Mapping other regions...
Mapping stack trace database regions...
Mapping activation context regions...

--- Usage Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
Free                                    123          75782000 (   1.835 GB)           91.78%
<unknown>                               124           5954000 (  89.328 MB)  53.04%    4.36%
Image                                   306           3c17000 (  60.090 MB)  35.68%    2.93%
Heap                                     42            c96000 (  12.586 MB)   7.47%    0.61%
Stack                                    18            600000 (   6.000 MB)   3.56%    0.29%
Other                                     8             5c000 ( 368.000 kB)   0.21%    0.02%
TEB                                       6              e000 (  56.000 kB)   0.03%    0.00%
PEB                                       1              3000 (  12.000 kB)   0.01%    0.00%

--- Type Summary (for busy) ------ RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_MAPPED                               57           5497000 (  84.590 MB)  50.22%    4.13%
MEM_IMAGE                               327           3c83000 (  60.512 MB)  35.93%    2.95%
MEM_PRIVATE                             121           1754000 (  23.328 MB)  13.85%    1.14%

--- State Summary ---------------- RgnCount ----------- Total Size -------- %ofBusy %ofTotal
MEM_FREE                                123          75782000 (   1.835 GB)           91.78%
MEM_COMMIT                              447           8197000 ( 129.590 MB)  76.94%    6.33%
MEM_RESERVE                              58           26d7000 (  38.840 MB)  23.06%    1.90%

--- Protect Summary (for commit) - RgnCount ----------- Total Size -------- %ofBusy %ofTotal
PAGE_READONLY                           188           3f7c000 (  63.484 MB)  37.69%    3.10%
PAGE_EXECUTE_READ                        68           2f22000 (  47.133 MB)  27.98%    2.30%
PAGE_READWRITE                          144           11be000 (  17.742 MB)  10.53%    0.87%
PAGE_WRITECOPY                           29            666666000 (   1.066 MB)   0.63%    0.05%
PAGE_READWRITE|PAGE_GUARD                12             1e000 ( 120.000 kB)   0.07%    0.01%
PAGE_EXECUTE_READWRITE                    4              a000 (  40.000 kB)   0.02%    0.00%
PAGE_NOACCESS                             2              2000 (   8.000 kB)   0.00%    0.00%

--- Largest Region by Usage ----------- Base Address -------- Region Size ----------
Free                                         7eb0000          56d90000 (   1.357 GB)
<unknown>                                    4e00000           2000000 (  32.000 MB)
Image                                       75231000            54d000 (   5.301 MB)
Heap                                         7a79000            376000 (   3.461 MB)
Stack                                        37e0000             fd000 (1012.000 kB)
Other                                       7fcc0000             33000 ( 204.000 kB)
TEB                                           e19000              3000 (  12.000 kB)
PEB                                           e16000              3000 (  12.000 kB)

看到了内存的摘要信息了。

虽然我们希望dmp文件尽量小,但一些必要的信息还是需要的。

标签: none

添加新评论