When looking at memory resource consumption issues you want to select the CPU, Heap, Pool and VirtualAlloc usage options in the Windows Performance Recorder UI. This way when you inspect the data later on in the Windows Performance Analyzer you will see how memory is being allocated and who is doing the allocating.
- [Instructor] CPU usage, Heap usage, Pool usage, and VirtualAlloc usage Resource Analysis Scenarios will be selected. Let's go over what these mean briefly. From the table, CPU usage is for analyzing how that application uses the CPU. Here, we select it so that we can get more insight as to what functions are being called during memory allocations. Since we won't have OpenCV symbols, we won't be able to see the name of the exact functions being called, but with CPU usage selected, we can perform some blackboxing.
More on this technique later on. Heap is for analyzing how memory from the heap is grabbed, used, and whether it's returned or not. Pool is for contiguous memory activity. Since memory comes in buckets or paged pool sets, this tells us how much memory in a working set is being used. By selecting this, we will be able to see the chart pool graphs under the memory section inside the Windows Performance Analyzer. The last one, VirtualAlloc is the most useful for memory analysis, and its the chart in which we will spend most of our time in, since it will chart out our app's virtual memory allocations.
This option will give us the most insight as to how the application manages its memory usage. It gives us the VirtualAlloc commit lifetimes chart, under the memory section, inside the Windows Performance Analyzer. What these recording options do will become clearer once we collect the trace and analyze it in WPA, the Windows Performance Analyzer.
- Setting up the application
- Looking at the source code
- Gathering memory leak evidence
- Optimizing the application