Memory Analysis editor

Double-clicking a session name opens the Memory Analysis editor for the selected session.

The top part of the editor shows the details for the data selected in the bottom part. The bottom part shows an overview of the entire memory analysis session data set:

Screen showing the details of selected allocations.

If the process does many allocations and deallocations, it could take some time for the traces and events to be registered, indexed, and shown.

The tabs at the bottom let you switch between several different data views:
  • Allocations tab — trace information about allocations and deallocations.
  • Bins tab — counters that track the general size of allocations and deallocations.
  • Bands tab — counters that track the allocator's preallocated memory bands.
  • Usage tab — information about the application's memory usage over time.
  • Settings tab — settings for the running process.

Select data

To select data in the overview, click and drag over the region you're interested in.

The Memory Analysis perspective updates the details to reflect the data region you've selected.

Control the page layout

The Memory Analysis editor has several icons that you can use to control the view:

Use this icon: To:

[Horizontal layout]

Set the Chart and Detail Pane to a horizontal layout, one beside the other

[Vertical layout]

Set the Chart and Detail Pane to a vertical layout, one above the other

[Restore]

Shows the Detail Pane if it's currently hidden

[Chart]

Hide the Detail Pane so the Chart pane has more display room

[Detail Pane]

Hide the Chart pane so the Detail Pane has more display room

[Toggle Chart Overview]

Toggle the Overview pane on and off

Control the overview

Right-click on the Overview pane to change the view options.

Overview pane's context menu

This menu includes:

By Timestamp
Show the events sorted by their timestamp. Because several memory events can occur with the same time stamp, it might present the events in a confusing order (for example, a buffer's allocation and deallocation events could be shown in the wrong order if they happen during the sampling interval).
By Count
Show events sorted by their event index. This is the default ordering in the Overview pane.
Filters...
Filter the events shown by size, type, or both. You can also hide the matching allocations and deallocations, so that you see only the unmatched ones:

Memory Analysis Filters

Zoom In
Zoom in on the selected range of events.
Zoom Out
Zoom out to the set of memory events that you previously zoomed in on.

Control the detail pane

To control the Detail view through its context menu:
  1. Right-click on the Detail pane.
  2. Choose a graph from the Chart Types menu:
    Option Description
    BarChart — a plain bar chart Bar Chart
    BarChart_3D — a 3D-bar chart 3D Bar Chart
    Differentiator — a plain differentiator chart Differentiator Chart
    Differentiator_3D — a 3D differentiator chart 3D Differentiator Chart

Allocations tab

The Allocations tab shows allocation and deallocation events over time. Select a range of events to show a chart and details for that specific range of events. Details (list of allocations and deallocations) are shown in the Memory Events view.

Screen showing allocations in the Memory Events view.

The Allocations Overview can be wide, so it could be divided into pages. You can use the Page field to move from one page to another, and you can specify the number of points to show on each page.

By changing the chart type and selecting a specific region to view, you con observe more information.

Screen showing memory allocation and deallocation events.

Bins tab

The Bins tab is available only to users working with a System Developer's profile

The allocator keeps counters for allocations of various sizes to help gather statistics about how your application is using memory. These counters track blocks up to each power of two (2, 4, 8, 16, and so on, up to 4096) and large blocks (anything over 4 KB).

The Bins tab shows the values for these counters over time:

Screen showing the Bins tab.

The counters are listed at the top of the Bins tab. Click the circle to the left of each counter to enable or disable the counter in the current view.

When the Bins tab is shown, the Chart pane shows allocations and deallocations for each bin at the time selected in the Details pane. The Details pane lists the memory events for the selected region of the Bins tab.

The Bins tab includes these additional buttons:
The Play icon
Play the selected range of the Use Bins; the Bins Statistics chart shows the usage dynamically.
The Play icon
Stop.

Because of the logging that's done for each allocation and deallocation, tracing can be slow, and it may change the timing of the application. You might want to do a first pass with the bins snapshots enabled to determine the hotspots or ranges, and on the second pass reduce the tracing to a certain range (minimum, maximum) to filter and reduce the log set.

Bands tab

The Bands tab is available only to users working with a System Developer's profile

For efficiency, the QNX allocator preallocates bands of memory (small buffers) for satisfying requests for small allocations. This saves you a trip through the kernel's memory manager for small blocks, thus improving your performance.

The bands handle allocations of up to 16, 24, 32, 48, 64, 80, 96, and 128 bytes in size, any activity in these bands is shown on the Bands tab:

Screen showing the Bands tab.

Usage tab

The Usage tab is available only to users working with a System Developer's profile

The Usage tab shows your application's overall memory usage over time.

Usage

Settings tab

The Settings tab is available only to users working with a System Developer's profile

You can configure the Memory Analysis settings for a running program from the Settings tab:

Screen showing the Memory Analysis tool.

Icons

Icon Description
The Refresh icon Update the current display with the latest data.
The Prevent Autorefresh icon Determine whether the Momentics IDE automatically refreshes the displayed information when streaming data from the target. When selected, you need to click Refresh to update the information.
The Collect Memory Leaks icon Gather information about any memory leaks encountered.
The Get Snapshots icon Take a snapshot of the current results.
The Get Traces icon Obtain a stack trace.

Field descriptions

Group/Field Description
Memory Errors group This group of configuration options controls the Memory Analysis tool's behavior when memory errors are detected.
Enable error detection Detect memory allocation, deallocation, and access errors:
  • Verify parameters in string and memory functions

    When enabled, check the parameters in calls to str* and mem* functions for sanity.

  • Perform full heap integrity check on every allocation/deallocation

    When enabled, check the heap's memory chains for consistency before every allocation or deallocation. This checking comes with a performance penalty.

  • Enable bounds checking (where possible)

    When enabled, check for buffer overruns and underruns. This is possible only for dynamically allocated buffers.

When an error is detected Memory Analysis takes the selected action when a memory error is detected. By default, it reports the error and attempts to continue, but you can also choose to launch the debugging tool or terminate the process.
Limit trace-back depth to Specify the number of stack frames to record when logging a memory error.
Perform leak check every (ms) Specify how often you want to check for leaks. This checking comes with a performance penalty.
Perform leak check when process exits When selected, look for memory leaks when the process exits, before the operating system cleans up the process's resources.
Memory Tracing group This group of configuration options controls the Memory Analysis tool's memory tracing features.
Enable memory allocation/deallocation tracing When selected, trace all memory allocations and deallocations.
Limit back-trace depth to Specify the number of stack frames to record when tracing memory events.
Minimum allocation to trace The size, in bytes, of the smallest allocation to trace. Use 0 to trace all allocations.
Maximum allocation to trace The size, in bytes, of the largest allocation to trace. Use 0 to trace all allocations.
Perform tracing every (ms) How often to collect information about your program's allocation and deallocation activity. When setting this, consider how often your program allocates and deallocates memory, and for how long you plan to run the program.
Memory Snapshots group Control the Memory Analysis tool's memory snapshot feature to capture memory information at a specific time.
Memory Snapshots Enable the capture of memory information to create a snapshot.
Perform snapshot every (ms) Specify the number of milliseconds between each memory snapshot.
Bins counters (comma separated) ex: 8, 16, 32, 1024 ... A comma-separated list of the memory bins you want to trace.

Last modified: 2015-07-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus