Qt5使用内存泄露检测工具—VLD
来源:互联网 发布:win8 mac修改器 编辑:程序博客网 时间:2024/05/16 10:40
No memory leaks detected.
Visual Leak Detector is now exiting.
Visual Leak Detector Version 2.4RC2 installed.
No memory leaks detected.
Visual Leak Detector is now exiting.
以上表示没有发现内存泄露。
测试2:在MainWindow的构造函数中添加一行代码:
new QWidget(0) ; // 这个会泄露
再次编译运行,结果为:
Visual Leak Detector Version 2.4RC2 installed.
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 9 at 0x00000000025FB4C0: 48 bytes ----------
Leak Hash: 0x8068CA22, Count: 1, Total 48 bytes
Call Stack (TID 10720):
0x00000000E35CAFC0 (File and line number not available): MSVCR120D.dll!operator new
e:\mydevelop\qt project\test\vldtest\mainwindow.cpp (11): VLDTest.exe!MainWindow::MainWindow + 0xA bytes
e:\mydevelop\qt project\test\vldtest\main.cpp (12): VLDTest.exe!main + 0xC bytes
c:\work\build\qt5_workdir\w\s\qtbase\src\winmain\qtmain_win.cpp (112): VLDTest.exe!WinMain + 0xE bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (618): VLDTest.exe!__tmainCRTStartup + 0x1B bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (466): VLDTest.exe!WinMainCRTStartup
0x00000000771C59CD (File and line number not available): kernel32.dll!BaseThreadInitThunk + 0xD bytes
0x00000000772FB891 (File and line number not available): ntdll.dll!RtlUserThreadStart + 0x21 bytes
Data:
78 DD 16 3F 01 00 00 00 50 FB 2C 00 00 00 00 00 x..?.... P.,.....
38 DF 16 3F 01 00 00 00 00 00 CD CD CD CD CD CD 8..?.... ........
00 00 00 00 00 00 00 00 80 FC 2C 00 00 00 00 00 ........ ..,.....
Visual Leak Detector detected 1 memory leak (100 bytes).
Largest number used: 902 bytes.
Total allocations: 902 bytes.
Visual Leak Detector is now exiting.
Visual Leak Detector Version 2.4RC2 installed.
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 9 at 0x00000000025FB4C0: 48 bytes ----------
Leak Hash: 0x8068CA22, Count: 1, Total 48 bytes
Call Stack (TID 10720):
0x00000000E35CAFC0 (File and line number not available): MSVCR120D.dll!operator new
e:\mydevelop\qt project\test\vldtest\mainwindow.cpp (11): VLDTest.exe!MainWindow::MainWindow + 0xA bytes
e:\mydevelop\qt project\test\vldtest\main.cpp (12): VLDTest.exe!main + 0xC bytes
c:\work\build\qt5_workdir\w\s\qtbase\src\winmain\qtmain_win.cpp (112): VLDTest.exe!WinMain + 0xE bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (618): VLDTest.exe!__tmainCRTStartup + 0x1B bytes
f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c (466): VLDTest.exe!WinMainCRTStartup
0x00000000771C59CD (File and line number not available): kernel32.dll!BaseThreadInitThunk + 0xD bytes
0x00000000772FB891 (File and line number not available): ntdll.dll!RtlUserThreadStart + 0x21 bytes
Data:
78 DD 16 3F 01 00 00 00 50 FB 2C 00 00 00 00 00 x..?.... P.,.....
38 DF 16 3F 01 00 00 00 00 00 CD CD CD CD CD CD 8..?.... ........
00 00 00 00 00 00 00 00 80 FC 2C 00 00 00 00 00 ........ ..,.....
Visual Leak Detector detected 1 memory leak (100 bytes).
Largest number used: 902 bytes.
Total allocations: 902 bytes.
Visual Leak Detector is now exiting.
这次检测到了内存泄露。
如上所示,使用vld检测内存泄露很容易,美中不足的是只能使用VC++编译器。尽管如此,我们也可以用它来在Win32下检测内存泄露,然后再使用其它编译器在其它平台上进行编译发布。
关于Linux的内存泄露,可以使用valgrind工具进行检测。
- Qt5使用内存泄露检测工具—VLD
- Qt5使用内存泄露检测工具—VLD
- 内存泄露检测工具[VLD, LeakDiag]
- 内存泄露检测工具[VLD, LeakDiag]
- 内存泄露检测工具[VLD, LeakDiag]
- 内存泄露检测工具[VLD, LeakDiag]
- vld 内存泄露检测工具vld的实现
- 内存泄露检测工具【VLD v2.2.3】
- 内存泄露检测工具【VLD v2.2.3】
- vld(Visual Leak Detector 内存泄露检测工具
- 内存泄露检测工具【VLD v2.2.3】
- vld(Visual Leak Detector) 内存泄露检测工具
- Visual C++内存泄露检测工具(VLD)
- Visual C++内存泄露检测工具(VLD)
- Visual C++内存泄露检测工具(VLD)
- 内存泄露检测工具使用
- 使用内存检测工具VLD遇到的问题
- 自己实现简易的内存泄露检测工具VLD
- iOS Security汇总
- 学习笔记——system(DIR)
- C#程序中:如何启用进程、结束进程、查找进程
- java的运行过程和平台的独立性
- CodeM美团点评编程大赛初赛A轮
- Qt5使用内存泄露检测工具—VLD
- Hibernate 二级缓存配置
- JDK笔记-IO流读写
- 浅谈Javaweb经典三层架构和MVC框架模式
- 将ojdbc6.jar添加到maven仓库
- 浅谈Javaweb经典三层架构和MVC框架模式
- DNA Pairing
- HEVC函数入门(9)——tile相关
- Html5 补充笔记 单行标签结束,css display input title