Resources | Resources |



Heap tracker example

C Heap Tracker example

The heap tracker example application, c_heaptracker, is posted on the Brew MP web site with this document.

The C Heap Tracker runs in the background and logs heap statistics every 5 seconds to the Brew MP Logger and to the heap_xxx.log file in the application's directory.

When C Heap Tracker is started, it automatically goes into the background after 5 seconds and starts logging. When the application is started a second time, it stops logging and automatically exits in 5 seconds.

The c_heaptracker package contains all the following files:

  • AEEAppGen.c
  • AEEModGen.c
  • c_heaptracker.c
  • c_heaptracker.cif
  • c_heaptracker_ico.png
  • c_heaptracker_res.h
  • c_heaptracker.sln
  • c_heaptracker.vcproj

Downloading and compiling the c_heaptracker sample

Note: You must have Brew MP SDK 1.0.2 or newer installed to run the C Heap Tracker.

  1. Click on the Sample Code link.
  2. Save the ZIP file to your local machine.
  3. Open the ZIP file and extract its contents to your Brew MP examples directory.
  4. Compile the application in Visual Studio.
  5. Run the application on the simulator.

Running C Heap Tracker

  1. Launch C Heap Tracker from App Manager.
  2. After 5 seconds, the application automatically goes into background to start logging heap statistics.

    You can monitor the logs in the Logger.

  3. To stop logging, launch C Heap Tracker again.

    After 5 seconds, the application automatically terminates.

All the heap statistics collected during the execution of C Heap Tracker are also saved in a file named heap_xxx.log under the application's directory (xxx is a number based on the time stamp).