Memory Problems view
Use this view to show any memory leaks and errors in your program found by memory analysis tooling. The following are some of the problems that can appear in the Memory Problems view:
- heap memory is corrupted
- an attempt to free a nonheap pointer
- writing to previously freed memory
- a memory leak of a specific size
The following example shows some typical memory problems that you might encounter using the Memory Problems view.
If you want to capture the memory error data and review these results outside of the Momentics IDE for BlackBerry, press CTRL-A to select all of the information contained within the table, and then press Ctrl-C to copy it as text to the clipboard.
For a description about the error message text, and for more information about the particular error, see Summary of error messages. For information about the general error categories, why the errors occur, and how to fix them, see Interpret errors during memory analysis.
The Memory Problems view provides the following columns in the problems table (not all columns are present by default, you can select columns using the view preferences):
|Severity||LEAK or ERROR with corresponding icon.|
|Description||An Error message.|
|Pointer||A pointer is involved in the error or leak.|
|Tid||The thread ID of the thread that was running in which and error was detected.|
|Pid||The process ID.|
|Binary||The binary for the top frame of a backtrace.|
|Location||The source location (file:line) for the top frame of a backtrace.|
|Timestamp||The library time stamp (can be wrapped data).|
|Event id||A unique event ID, ordered by error occurrence.|
|Trap Function||A function that was checked when an error is detected.|
|Alloc Kind (prev. Operation)||A type of heap allocation involved in an error.|
|Count||When grouped, it represents a count of the grouped errors.|
|State - "in use" - pointer is used, "freed"||The pointer is freed.|
The Memory Analysis view provides the following functionality and features:
- Double-click a particular problem in the list, and then the Momentics IDE highlights the corresponding source code line (if it exists).
- Click a particular problem in the list, the problem is selected, and the Momentics IDE updates problem backtrace in Memory Backtrace view.
- Click a column header, and then the Momentics IDE sorts the data by the column value.
- Drag and drop columns by their header to rearrange the column order.
- Press Ctrl-C (or use your specific platform copy command). The Momentics IDE copies the text representation of the problem to the clipboard.
- Double-click the view header to maximize the view (or return to normal when currently maximized).
- Right-click in the table to open the context menu. For a list of context menu items, see below.
- Remove Events - remove (by filtering) the current events from the view. Enabled when running.
- Dump Leaks - execute the dump leaks command (the application has to run the control thread). Enabled when running.
- Open Filter Dialog - open the Filter dialog (see description below).
- Prevent Auto-Refresh - don't perform a refresh automatically. Enabled when running.
- Refresh - force a refresh.
- View Menu - open the View menu (see description below).
- Minimize - minimize the view.
- Maximize - maximize the view (or return to normal size when currently maximized).
- Filter… - opens the traces filter.
- Up to Event - show all errors up to this current error (by time occurrence).
- From Event - show only the errors from this current error (by time occurrence).
- Same backtrace - show only errors with the same backtrace.
- Show All - reset the filter.
- None - no grouping is done.
- Type - group by error type.
- Backtrace - group errors with the same backtrace under a single group. For group entries, the nonaggregated column shows a value for the first entry.
- Thread - group by thread ID.
- Severity - group by error severity.
- Show Backtrace - activates the Memory Backtrace view and shows the current backtrace in the view.
- Show Source - show the context menu and double-click, then go to the selected event source location.
- Preferences… - open the view preferences dialog to set the column selection and order.
Memory Problems Filter
The Memory Problems filter lets you filter data by certain fields, such as a pointer, a range, a file, a binary or a thread. You can open the Memory Problems filter by running the Filter… action from the Memory Problems view (from context menu, action menu, or action toolbar).
|Pointer||Filter field based on the pointer value involved in the error condition (usually a pointer to the heap). This field accepts the individual pointer values, such as 0x8023896 or ranges such as 0xb34000-0xb44000.|
|Backtrace Id||This field is automatically set when you select quick for errors of the same backtrace.|
|Time Stamp Range||Filter based on the timestamp. This filter can accept individual values or a range of values. The range can be open-ended, such as 100000-*.|
|Event Id Range||Filter based on the error ID (the Event ID column). It accepts individual values or ranges. The range can be open-ended, such as 25-*.|
|Files||Select a file where the error occurred, and all files referenced in the backtrace of the error.|
|Binaries and Libraries||Filter based on the binary or library where the error occurred, and all binaries referenced in the backtrace of the error.|
|Threads||When a problem is detected, filter errors based on the thread ID of a running thread.|
Memory Problems Preferences
Memory Problems Preferences lets you control the look of the Memory Problems view. You can select the columns you want to see in the view, as well as other preferences. You can open view preferences from global preferences (Window > Preferences > QNX > Memory Analysis > Memory Problems View, or from the view Preferences… action.
|Show full path||Show the full file path location in the Location column. The default is only the base name.|
|Visible Columns||Show the selected columns to display in the view, and the order in which to display them. You can select columns and rearrange them using the Up and Down buttons, or by using drag-and-drop in the view itself.|
|Max rows||Limit the maximum number of rows to display in the view. For performance purposes, a maximum limit of 1000 is recommended; however, if you have more rows, use grouping or filtering to reduce the number.|
View statistics for memory problems
To view statistics for memory problems (by error type):
- From the Memory Problems view, right-click anywhere on the table to open the context menu.
- Select Preferences…
- In the Preferences dialog, select the Expand, Severity, Description and Count columns, and then deselect all of the remaining options.
- Click OK.
Right-click, and then select Group
By > Type.
Last modified: 2015-07-24