Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Heap Analyzer Help

Heap Analyzer is a PC-side UI tool that acts as a one-click solution for heap analysis and diagnostics.

Prerequisites

  • Heap Analyzer requires Brew MP Platform version 1.0.2.410 and higher.
  • On physical targets, Heap Analyzer works over the Brew MP Connect Gateway USB device. This requires the device to be Developer Mode enabled. See the Brew MP Application Development Primer or Connect Technology Guide on the Brew MP website for more information.

The UI tool is organized into the Configuration, Diagnostics, General Statistics and Log Window panels as described in this section and shown in the following window.

Configuration panel

From the Configuration panel, you can do the following:

  • Select a target (device or Simulator).
  • Perform a heap walk on the selected target.
  • Generate Bucket, Heap, Page, and Module statistics.
  • Perform on-device logging.
  • Import crash dump and heap logs.
  • Explore and filter heap dumps.

The following is an example of the Configuration panel:

Walk Heap: Verifies whether the target is equipped with dependent modules and executables. If not, these files are installed to the target. A progress bar displays the time remaining for the heap walk to finish.

Buckets Stat: Opens a window containing statistical data, as shown in the following example.

Exporting and importing data files

The Bucketized Heap Stats window, as well as other windows, includes the ability to Export and Import:

  • Export: Opens a Save As dialog box. You can save a .csv file (a file format used by Excel) in a default location (C:\Users\<username>\AppData\Roaming\Qualcomm\Brew MP\HeapAnalyzer\) or browse to another location.
  • Import: Opens an Open dialog box. You can open a .csv file previously saved in this location. The statistical data is opened in the Heap Analyzer window.

Heap Stats: Opens a window containing statistical data as shown in the following example.

The kernel heap statistical data is in bytes, except Heap Frag Index that is a percentage:

  • Total Heap Size
  • Max Free Node Size: Size of the biggest heap node that is free
  • Free Heap Size: Total size of all free heaps
  • Heap Frag Index: Calculates how much of the kernel heap is currently fragmented (i.e., a lower number means less fragmentation and a higher number means more fragmentation)

Note: Page Stats is only available on a device target, not the Simulator (an error message displays in the Log window).

Page Stats: Opens a window containing statistical data as shown in the following example.

The Page Heap statistical data is in bytes, except Page Heap Frag Index that is a percentage:

  • Contiguous Free: Heap nodes that are free and contiguous (i.e., not fragmented)
  • Total Free: Total size of all free nodes.
  • Page Heap Frag Index: Calculated based on the above value (i.e., higher contiguous free heap nodes means a lower fragmentation index)

Module Stat: Activates a new window for the Running Module Statistics, which lists MaxHeapUsed and CurrentHeapUsage in bytes for each ClassID that is currently running in the target. There is a status label that updates the time stamp when the statistics were retrieved.

Start/Stop On-Device Logging: Allows you to collect heap logs from the device or simulator and import them to the PC.

Import Crash Dump: Opens a prompt to browse to the location of a DumpLog on your computer, and import it to Heap Analyzer.

Note: If modules are not present, the modules are installed. Then, reset the target before performing heap walk on the target.

The Configuration panel provides a list of available heap dumps, as .csv log files. An Explore button opens a explorer window to the location of these log files. The default location for heap dump log files is <%APPDATA%\Qualcomm\Brew MP\HeapAnalyzer>.

Diagnostics panel

The Diagnostics panel provides the following tabs.

  • Context-Id Usage: The aggregation is based on the context ID, displaying the module name, total number of nodes and the total size for each context-Id. The percentage field provides total size used by each context id as a percentage of the total heap size.

  • All Nodes: Provides a complete view of each heap node - Address, Size, Type, Context ID, Owner, Task Name, Tag, Timestamp.

  • Used Nodes Table: Aggregates all the used nodes based on node size, displays the total number of nodes in each node size, total size used, total size of each node size as a percentage of the maximum total size of any node size), and a percentile usage bar graph of the total size used.

  • Free Nodes Table: Aggregates all the free nodes based on node size, displays the total number of nodes in each node size, total size used, total size of each node size as a percentage of the maximum total size of any node size, and a percentile usage bar graph of the total size used.

  • Visualizer: Displays a graphical view of the heap usage for free and used nodes.

  • Settings: Allows you to configure settings before running Heap Analyzer.

General Statistics panel

The General Statistics panel provides free size available, size allocated by system, size allocated by modules, size allocated by heap internal, total allocated size, and the total size of the heap. This panel serves as a reference when interpreting data in different tabs in the Diagnostics panel. It also contains a list of the top ten free nodes sizes.

Log Window panel

The Log Window panel provides status information during heap walks, warnings, and error messages related to the Heap Analyzer UI activities.