Forum Discussion

uvcbo's avatar
14 years ago

Memory leaks

I`m using AQtime 6 and try to find some memory leaks in a Windows Service, developed in C++ Borland Developer Studio 2006,



the app receive some data via IDHTTPServer and in between 2560 - 2600 connections to the HTTPServer the memory is growing with 1200 k,

try to do a allocation Profiler but having problem to analyze the result,



appreciate any help.

//Christer

1 Reply

  • Hi Christer,


    There is a special help topic regarding this: "Analyzing Allocation Profiler Results" (http://www.automatedqa.com/support/viewarticle.aspx?aid=40).


    BTW, here is a description of the general scheme of finding a leak in an application with AQtime:


    1. Specify the code to be profiled. See the 'Controlling What to Profile' help topic for details.


    2. Choose the needed profiler (the Allocation profiler in your case) and set up the profiling settings according to your needs.


    3. Start profiling the application.


    4. Move the application to the state it is in before a possible memory leak can occur.


    5. Clear the profiling results by selecting the 'Run | Clear Results' menu item.


    6. Perform actions that can lead to a leak and return the application to the state it is in step 4. If there are no leaks, all of the allocated memory should be released at this point.


    7. Get the current profiling results by clicking the 'Get Results' button on the toolbar, pressing the Ctrl-R shortcut or selecting the 'Run | Get Results' menu item.


    8. Analyze the results. In this step, you should be able to find a leaking object.


    To analyze results of the Allocation profiler, select the 'Classes' section of the profiling report (the 'Last Results | <Profiling Date> | Classes' node in the Explorer panel) and see the 'Live Count' value for different object types. The object type that has a non-zero value for this column has live instances that were not released. To see these instances, double-click the 'Objects' node. After that, you will see the list of live objects in the Report panel.


    To find out where a live object was created, double-click the needed object and open the Details panel. The panel will contain the call stack of the call that allocated the memory for the object. Double-click specific lines of the call stack to see the source code that corresponds to these lines if the path to the source code files is specified in your AQtime project.


    Using this information, you can find out exactly where the leaked object was created. Of course, AQtime cannot tell you when it must be destroyed as it completely depends on your application's logic.


    If the information provided does not help you solve the problem, please describe the problems you are facing in detail.