Visual Leak Detector(vld) 内存泄露检测

hili210 2014-11-03 03:20:50
一些本地文件的泄露可以检测并能知道在哪一行出错,但是有些泄露是系统库文件,貌似很难到问题所在
因为是数据库服务器端,所以内存泄露得要解决掉,工程是MFC对话框模式(直接建一个对话框工程加入vld检测没有任何泄露)

这个是内存泄露的部分信息:

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 8 at 0x016B8990: 108 bytes ----------
Call Stack:
f:\dd\vctools\crt\crtw32\heap\malloc.c (58): DBServer.exe!_heap_alloc_base
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (431): DBServer.exe!_heap_alloc_dbg_impl + 0x9 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (239): DBServer.exe!_nh_malloc_dbg_impl + 0x19 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (601): DBServer.exe!_calloc_dbg_impl + 0x20 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (652): DBServer.exe!_calloc_dbg + 0x1D bytes
f:\dd\vctools\crt\crtw32\startup\stdenvp.c (127): DBServer.exe!_wsetenvp + 0x14 bytes
f:\dd\vctools\crt\crtw32\startup\crt0.c (233): DBServer.exe!__tmainCRTStartup + 0x5 bytes
f:\dd\vctools\crt\crtw32\startup\crt0.c (165): DBServer.exe!wWinMainCRTStartup
0x758586E3 (File and line number not available): KERNEL32.DLL!BaseThreadInitThunk + 0xE bytes
0x77BDBE19 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x85 bytes
0x77BDBDEC (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x58 bytes
Data:
28 93 6B 01 F8 DE 6D 01 40 19 3D 01 7E 00 00 00 (.k...m. @.=.~...
48 00 00 00 02 00 00 00 08 00 00 00 FD FD FD FD H....... ........
41 00 50 00 50 00 44 00 41 00 54 00 41 00 3D 00 A.P.P.D. A.T.A.=.
43 00 3A 00 5C 00 55 00 73 00 65 00 72 00 73 00 C.:.\.U. s.e.r.s.
5C 00 DD 84 29 59 5C 00 41 00 70 00 70 00 44 00 \...)Y\. A.p.p.D.
61 00 74 00 61 00 5C 00 52 00 6F 00 61 00 6D 00 a.t.a.\. R.o.a.m.
69 00 6E 00 67 00 00 00 FD FD FD FD i.n.g... ........


---------- Block 13 at 0x016B8A40: 108 bytes ----------
Call Stack:
f:\dd\vctools\crt\crtw32\heap\malloc.c (58): DBServer.exe!_heap_alloc_base
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (431): DBServer.exe!_heap_alloc_dbg_impl + 0x9 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (239): DBServer.exe!_nh_malloc_dbg_impl + 0x19 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (601): DBServer.exe!_calloc_dbg_impl + 0x20 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (652): DBServer.exe!_calloc_dbg + 0x1D bytes
f:\dd\vctools\crt\crtw32\startup\stdenvp.c (127): DBServer.exe!_wsetenvp + 0x14 bytes
f:\dd\vctools\crt\crtw32\startup\crt0.c (233): DBServer.exe!__tmainCRTStartup + 0x5 bytes
f:\dd\vctools\crt\crtw32\startup\crt0.c (165): DBServer.exe!wWinMainCRTStartup
0x758586E3 (File and line number not available): KERNEL32.DLL!BaseThreadInitThunk + 0xE bytes
0x77BDBE19 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x85 bytes
0x77BDBDEC (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x58 bytes
Data:
C0 9A 6B 01 00 E1 6D 01 40 19 3D 01 7E 00 00 00 ..k...m. @.=.~...
48 00 00 00 02 00 00 00 0D 00 00 00 FD FD FD FD H....... ........
43 00 6F 00 6D 00 53 00 70 00 65 00 63 00 3D 00 C.o.m.S. p.e.c.=.
43 00 3A 00 5C 00 57 00 69 00 6E 00 64 00 6F 00 C.:.\.W. i.n.d.o.
77 00 73 00 5C 00 73 00 79 00 73 00 74 00 65 00 w.s.\.s. y.s.t.e.
6D 00 33 00 32 00 5C 00 63 00 6D 00 64 00 2E 00 m.3.2.\. c.m.d...
65 00 78 00 65 00 00 00 FD FD FD FD e.x.e... ........


---------- Block 2 at 0x016B8BF8: 60 bytes ----------
Call Stack:
f:\dd\vctools\crt\crtw32\heap\malloc.c (58): DBServer.exe!_heap_alloc_base
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (431): DBServer.exe!_heap_alloc_dbg_impl + 0x9 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (239): DBServer.exe!_nh_malloc_dbg_impl + 0x19 bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (302): DBServer.exe!_nh_malloc_dbg + 0x1D bytes
f:\dd\vctools\crt\crtw32\misc\dbgheap.c (160): DBServer.exe!_malloc_dbg + 0x1B bytes
f:\dd\vctools\crt\crtw32\startup\mlock.c (276): DBServer.exe!_mtinitlocknum + 0x13 bytes
f:\dd\vctools\crt\crtw32\startup\mlock.c (332): DBServer.exe!_lock + 0x9 bytes
f:\dd\vctools\crt\crtw32\lowio\ioinit.c (125): DBServer.exe!_ioinit + 0x7 bytes
f:\dd\vctools\crt\crtw32\startup\crt0.c (221): DBServer.exe!__tmainCRTStartup + 0x5 bytes
f:\dd\vctools\crt\crtw32\startup\crt0.c (165): DBServer.exe!wWinMainCRTStartup
0x758586E3 (File and line number not available): KERNEL32.DLL!BaseThreadInitThunk + 0xE bytes
0x77BDBE19 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x85 bytes
0x77BDBDEC (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x58 bytes
Data:
00 00 00 00 B8 D6 6D 01 BC 48 3D 01 14 01 00 00 ......m. .H=.....
18 00 00 00 02 00 00 00 02 00 00 00 FD FD FD FD ........ ........
FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 ........ ........
00 00 00 00 A0 0F 00 00 FD FD FD FD ........ ........


还有一些,就不贴出来了,如果需要什么代码的话我会尽快贴出来,我已经看过所有内存泄露,没有提示本地文件哪一行出现问题,貌似就剩下了这些库文件了,好像是堆栈的内存泄露,求高手,谢谢了
...全文
211 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hili210 2014-11-03
  • 打赏
  • 举报
回复
嗯……也是,虽说有点不放心,不过也没办法,我今天晚上回去再看看
赵4老师 2014-11-03
  • 打赏
  • 举报
回复
检查是否资源泄漏的办法之一: 在任务管理器 进程 查看 选择列 里面选择:内存使用、虚拟内存大小、句柄数、线程数、USER对象、GDI对象 让你的程序(进程)不退出,循环执行主流程很多遍,越多越好,比如1000000次甚至无限循环,记录以上各数值,再隔至少一小时,越长越好,比如一个月,再记录以上各数值。如果以上两组数值的差较大或随时间流逝不断增加,则铁定有对应资源的资源泄漏!
Saleayas 2014-11-03
  • 打赏
  • 举报
回复
这个不要考虑。

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧