To illustrate the use of the Allocation profiler, we will use several sample applications: Boxing, References, VCL and Allocation.
Let’s start with the Boxing example.
Microsoft Visual Studio 2005 Projects:
<AQTime Samples>\Managed\VS2005\Allocation\Boxing\CS - Microsoft Visual C# .NET
<AQTime Samples>\Managed\VS2005\Allocation\Boxing\VC - Microsoft Visual C++ .NET
<AQTime Samples>\Managed\VS2005\Allocation\Boxing\VB - Microsoft Visual Basic .NET
Microsoft Visual Studio 2013 Projects:
<AQTime Samples>\Managed\VS2013\Allocation\Boxing\CS - Microsoft Visual C# .NET
<AQTime Samples>\Managed\VS2013\Allocation\Boxing\VC - Microsoft Visual C++ .NET
<AQTime Samples>\Managed\VS2013\Allocation\Boxing\VB - Microsoft Visual Basic .NET
|Note:||You can also open Visual Studio samples in later versions of Visual Studio.|
|On Windows Vista and later, AQTime samples are located in the <Users>\Public\Documents\AQTime 8 Samples folder. On other operating systems, the samples reside in the <Documents and Settings>\All Users\Documents\AQTime 8 Samples folder.|
To profile this example with AQTime, do the following:
Open the application in AQTime.
Enable All Project Modules by Classes and disable Entire .NET Code in the Setup panel.
Select Allocation Profiler from the Profilers drop-down list on the Standard toolbar.
Select Allocation Profiler from the Profilers drop-down list displayed in the AQTime menu of Microsoft Visual Studio.
Select Allocation Profiler from the Current Profiler submenu displayed in the AQTime menu of Embarcadero RAD Studio.
Select Normal from the Profiling Mode drop-down list box that is displayed on AQTime’s Standard toolbar.
Select Normal from the Profiling Mode drop-down list box that is displayed on Visual Studio’s AQTime toolbar.
Click the Normal button on RAD Studio’s AQTime Profiling Modes toolbar.
Switch to the Collect Stack Information Pane shown to the middle right of the Setup panel and make sure that the All Project Modules and Entire .NET Code check boxes and the corresponding Collect info about lines radio buttons are selected.
Press Run on the Standard toolbar.
Select Run from Visual Studio’s AQTime menu, or press Visual Studio’s Run button while any of AQTime panels is active.
Select Run With Profiling from Embarcadero RAD Studio’s AQTime menu.
AQTime will launch the profiled application. Wait until the application window is displayed on the screen.
The Boxing application contains two routines:
SimpleValues. The first of them creates 100 structures and saves them to a
Hashtableobject. The second routine also creates 100 structures of the same type but saves them to an array.
During startup, the application calls the
BoxedValuesroutine and displays two messages that notify you about the start and end of the routine.
BoxedValues finished. Press Enter...
Press Enter to continue.
- The application will call the
SimpleValues finished. Press Enter...
Press Get Results on AQTime’s Standard toolbar and AQTime will generate the results.Select Get Results from Visual Studio’s AQTime menu and AQTime will generate the results.Select Get Results from the AQTime menu and AQTime will generate the results. We will analyze this result set later.
Press Enter. The application will be closed and AQTime will generate the results again. This result set is not of interest to us.