See how to profile resource usage:
Profiling Resource Usage With AQTime |
The Resource profiler checks to see if the application under profiling creates Windows resources correctly and releases all of the allocated resources. Both 32-bit and 64-bit applications are supported.
The following sections provide the Resource profiler overview:
General Information
The Resource profiler keeps tabs on the Windows resource usage monitoring resource allocations and deallocations and calls to the resource management routines in 32-bit and 64-bit applications. For instance, if the application attempts to delete a pen currently selected in the device context, the profiler will add the “Attempt to delete the object selected in DC” error message to the Report panel. The function calls, which the Resource profiler traces, are divided into the following groups:
- GDI and User Resources
- Kernel Resources
- COM Resources
- Registry Resources
- Print Spooler Resources
- GDI+ Resources
For the full list of the checked resource management functions, see Resource Profiler - List of Checked Functions.
Note: | AQTime may report that there was an attempt to free a non-allocated resource, while this resource actually is allocated. AQTime may also report about non-existent resources if you profile your application using the “Attaching to Process” feature. For more information, see Non-Existent Resources in the Report Panel. |
The Resource profiler always traces the entire application to be profiled. The Resource profiler operates during the entire run of the application. It takes no account of triggers and actions and disables the Enable/Disable Profiling button.
The Resource profiler supports stack areas when collecting stack information at run time. For more information on specifying the stack areas of modules that are included in the collected stack, see Specifying Modules to Be Included Into the Call Stack.
Profiling Unmanaged and Managed Applications
The Resource profiler tracks calls to Windows API functions that deal with resources. It is meant to be used for unmanaged (native-code) applications. In managed (.NET-connected) applications, the work with resources is implemented with objects that support the IDisposable
interface. The Resource profiler does not track allocations and deallocations of these resources.
Nevertheless, you can use the Resource profiler to see how your managed code works with Windows resources. This may be helpful for information purposes. In order for AQTime to be able to do this, you need to add the mscorwks.dll assembly to your AQTime project. See Using Resource Profiler With .NET Applications.
Filtering Results
By default, the Resource profiler reports only the resource types whose instances had been allocated before the results were generated. However, the profiler includes the Show all resources option that lets you extend the report. This option is displayed on the ProfilerReportProfiler toolbar ( ). If this option is enabled, the profiler reports about all the resource types the profiler traces even if no instances were allocated for these resource types. If you do not want to see these resource types in the report, uncheck the Show all resources option.
The second option on the same toolbar, View project classes only, controls for which modules AQTime displays resource-profiling results. If this option is disabled (this is its default state), AQTime displays profiling results for all the modules used by the application being profiled. Often, this setting substantially extends the report. If the option is enabled, AQTime displays profiling results only for those modules that are added to the Setup panel.
The third toolbar option, Filter objects by stack, operates on a similar principle. If this option is enabled, AQTime only displays those objects that were created in one of the “Setup” modules. If the option is disabled (default state) all traced objects are displayed.
The last filtering option is Filter standard leaks, it hides information about resource leaks that occurred in standard third-party classes and libraries (VCL, MFC and others).
Using these options, you can get rid of profiling results you do not need at the moment.
See Also
Resource Profiler
Resource Profiler Results - Overview
Resource Profiler Options
Resource Profiler Tutorial
Profiling .NET Applications - Specifics