惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - Ady Lee

【C语言】二维数组在内存中的存储方式 C++:继承访问属性(public/protected/private) Makefile文件基本格式 异步IRP的教训(已附DUMP) IRQL 文件过滤驱动中的重入处理 FastIO 缓存管理器 浅议Windows 2000/XP Pagefile组织管理 FCB CCB FileObject WDM驱动改可手动加卸载的NT驱动 Windows 文件过滤驱动经验总结 PKCS #1 RSA Encryption Version 1.5 解决STM32 I2C接口死锁在BUSY状态的方法讨论 亲测实验,stm32待机模式和停机模式唤醒程序的区别,以及唤醒后程序入口 python中使用 C 类型的数组以及ctypes 的用法 python ctypes库3_如何传递并返回一个数组 Windbg 内核态调试用户态程序然后下断点正确触发方法(亲自实现发现有效) ___security_cookie机制,防止栈溢出 security cookie 机制(2)--- 初始化___security_cookie
用poolmon来查找内存泄露
Ady Lee · 2019-07-11 · via 博客园 - Ady Lee

用poolmon来查找内存泄露

poolmon C:\WinDDK\7600.16385.1\tools\Other\i386\poolmon.exe
gflags     C:\WinDDK\7600.16385.1\Debuggers\gflags.exe

[步骤]:
1).修改注册表
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

GlobalFlag 0x000400

2).gflags.exe

勾选 Enable pool tagging

3).重启系统

4).打开poolmon 看到详细的内存分配释放信息
P - 切换分页非分页内存

D - 按分配与未释放的差来排列

5).设置命令行窗口
右键 - 属性 - 选项 - 编辑选项 - 勾选快速编辑模式

还可以把缓冲区大小调大点

6).鼠标左键选择全部内容,回车

7).打开记事本,CTRL+V

 Memory: 3136424K Avail: 2672512K  PageFlts:  2504   InRam Krnl: 2864K P:58704
 Commit: 305964K Limit:5065664K Peak: 598068K            Pool N:14872K P:63108
 Tag  Type     Allocs            Frees            Diff   Bytes      Per Alloc

 NtFs Paged     22354 (   0)     16458 (   0)     5896  310656 (     0)     52
 MmSt Paged      8892 (   3)      3049 (  25)     5843 11600216 (-17480)   198
 CMVa Paged    497244 ( 243)    491734 ( 155)     5510  275648 (  3528)     50
 Ntf0 Paged     39087 (  32)     33784 (  32)     5303  184280 (     0)     34
 MmSm Paged      5049 (   0)       456 (   0)     4593  293952 (     0)     64
 FSim Paged      3971 (   0)        61 (   0)     3910  500480 (     0)    128
 IoNm Paged    400361 ( 645)    396911 ( 723)     3450  501632 ( -7424)    145
 NtfF Paged      3430 (   0)       727 (   0)     2703 2551632 (     0)    944
 Ntfo Paged     31970 (  64)     29291 (  64)     2679  267424 (     0)     99
 Ntff Paged     10264 (   0)      7616 (   0)     2648 2203136 (     0)    832
 CMNb Paged    565888 ( 224)    563791 ( 272)     2097  117432 ( -2024)     56
 CMDa Paged     58237 (  27)     56171 (  45)     2066  259568 ( -1464)    125
 Sect Paged     53359 ( 206)     51324 ( 229)     2035  177640 ( -2072)     87
 CMVI Paged     69712 (  36)     68199 (  75)     1513   53048 (  -112)     35
 NtFL Paged      1426 (   1)         0 (   0)     1426   57040 (    40)     40
 Ntfc Paged      3789 (  73)      2384 (  97)     1405  101160 ( -1728)     72
 SYSA Paged      6191 (   0)      4871 (   0)     1320  152056 (     0)    115
......

这样,通过连续多次记录相隔一定时间的poolmon输出信息并比较它们的差别,可以找出存在内存泄露的程序

[参考资料]:

http://support.microsoft.com/kb/177415/zh-cn
http://blog.csdn.net/moreorless/article/details/3369525