Use the Debug Diagnostic Tool to troubleshoot memory leaks

1. Install Debug Diagnostic Tool.exe, and download it from the official link of Microsoft.

2. Run the program UnitTest.exe that needs to be tested.

3. Open DebugDiag1.2, select "Native (non-.Net) Memory and Handle Leak", and then next.

4. Select the UnitTest.exe process, next.

5. Keep the default option, next.

6. Generate Leak Rules, keep the default option, next.

7. Keep "Active the rule now" selected, Finish.

8、Tools -> Options And Settings

(1) Folders and Search Paths: 添加Symbols文件: SRV*D:\symbol*http://msdl.microsoft.com/download/symbols;D:\xxx-YourProjectPdbFilePath.

The dump file save path remains unchanged.

 

(2) Preferences: Check "Record call stack information immediately when detecting memory leaks". It is not recommended to check when the test time is >15mins.

 

9. Run the UnitTest program, in order to generate more leaks, you can run it several times.

10. In the Rules tab, right-click Leak Rule -> Dump Target Process(es) -> Create Full Userdump(s). To generate a dump file, the location is E:\Program File

Guess you like

Origin blog.csdn.net/chenlycly/article/details/80075888