With the trace file for the optimized OpenCV BlendBitmaps.exe application, its time to verify the memory leak issue is resolved by opening up the trace in WPA and inspecting the VirtualAlloc usage chart and the commit call stack. It is here that the dramatic difference in memory usage becomes visible. Before optimization the VirtualAlloc commit life times chart showed an increasing stair case of memory being consumed which showed no end in site. Now after optimization, the current memory usage remains constant (no more rising staircase). This is the intended behavior and how you should optimize your application to prevent memory leaks.
- [Instructor] Let's double-click on the…BlendBitmaps_Optimized.etl trace file…to open it up in WPA, the Windows Performance Analyzer.…Once it's done loading, let's maximize the WPA window…by clicking on the Maximize button in the top right.…Now we'll perform the same steps we did earlier…when we were loading and inspecting…the BlendBitmaps trace file.…First, we want to configure the symbol paths…so we can see the function names.…Let's go to the Trace tab in the top left corner…and click on Configure Symbol Paths.…Now, if you see an invalid path to the symbols folder…for our previous trace file, BlendBitmaps, click on it,…and click on this trash button at the bottom to delete it.…
Now we need to have two paths specified here.…One is to the Microsoft symbol server,…which we can see right here.…If you don't see this,…add it by clicking on the plus button.…Also, another symbol path we need to add is to our new…BlendBitmaps_Optimized NGEN PDB folder.…Since that folder is in the same directory…as this trace file, we can simply add it…
- Setting up the application
- Looking at the source code
- Gathering memory leak evidence
- Optimizing the application