When you profile your application with the Allocation profiler, AQtime gathers a lot of profiling results, especially if you command it to collect stack information by lines. Working with a great number of results can cause out-of-memory issues and performance problems in AQtime. For example, you may not be able to compare or merge results. To avoid these problems, it is recommended to reduce the amount of collected profiling results in order for AQtime to be able to process them. You can use the following recommendations:
When you profile an application with the Allocation profiler, you specify whether the profiler should collect information on call stacks when creating objects. The call stack lets you determine where in your code the unreleased objects were created. You can command AQtime to collect the stack by routines or by lines by using the Collect Stack Information Pane. If the Collect info about lines option that corresponds to the used stack area is selected in this panel, the results will contain information about routines that created class instances or allocated memory blocks as well as about the source lines where class instances were created or memory blocks were allocated. This is useful information, but it requires time and memory.
If you do not need information about source lines, select Routines only for needed stack areas. In this case call stack entries will include information only about routines. Since information on lines is not collected, AQtime will consume less memory and resources.
If you want just to find leaks without fixing them, turn off collecting call stack data by clearing all the check boxes shown in the Collect Stack Information Pane. The profiling results will include information only about objects and memory blocks (number, size in memory and so on), but will not contain call stack data for them. This significantly reduces the amount of profiling results in memory.
Another way to reduce the amount of collected results is to restrict classes to be profiled. To define which classes will be profiled, you can use custom areas. Quite often, the Allocation profiler is run with the All Project Modules by Classes option enabled. In this case, the profiler collects information on all classes in all modules of your project. To reduce the number of collected results, you can:
Switch to the Setup panel.
Disable the All Project Modules by Classes option.
Create a new class-level area.
Add the desired classes to the area.
Now, when you run the Allocation profiler, AQtime will analyze only the classes that you added to the area.
To determine which classes need to be analyzed, you can run the Allocation profiler with the All Project Modules by Classes setting enabled:
Enable the All Project Modules by Classes setting to command AQtime to profile the entire application. To disable collecting stack, clear all check boxes shown in the Collect Stack Information Pane.
Start the Allocation profiler.
Profile your application and perform actions that lead to a leak. When you are done, close the application, AQtime will generate profiling results.
To find the classes whose instances existed at the moment of result generation, select the Classes Data category in the Explorer panel and then take a look at the Live Count column in the Report panel. If the column value is greater than 0, class instances still exist in memory.
Create a new area and add only the leaked classes to it.
Now you can run the profiler with the All Project Modules by Classes setting disabled and select the stack areas you want to include in a stack in the Collect Stack Information Pane. The profiling results will contain information only on the classes added to the custom area and will occupy less memory and hard disk space.