Memory Events view
Use this view to show the memory events (allocation and deallocation) that are found in your program by memory analysis tooling.
To populate the view, click a session or session element (such as a thread, file) from the Session View (see Memory Session view), or activate the memory analysis editor (see Memory Analysis editor), and then select a region in the allocations chart (when the view is synchronized).
If you want to capture the memory event 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.
The Memory Events view provides the following columns in the events table (not all columns are present by default, you can select columns using the view's preferences):
|Kind||A kind of allocation (malloc, calloc, new, free, and so on) with a matched icon (the icon has checkmark if the allocation has a corresponding free.)|
|Requested Size||The size of memory in bytes requested.|
|Actual Size||The size of the memory block allocator used.|
|Pointer||A pointer value.|
|Tid||The thread ID of thread that did the allocation.|
|Pid||The process ID.|
|CPU||The CPU on which the allocation or deallocation occurred.|
|Binary||The binary or library name of the requester (the top frame of a backtrace).|
|Location||The file:line of the requester (the top frame of a backtrace).|
|Timestamp||The timestamp of an allocation (the timestamp can wrap around).|
|Event id||The unique ID in the order of appearance.|
|Average size||When grouped, it refers to the average size of the requested allocations.|
|Max size||When grouped, it's the maximum size of the requested allocations.|
|Count||When grouped, it's the count of the grouped allocations.|
- An allocation with a matching deallocation.
- A deallocation with a matching allocation.
- An allocation without a matching deallocation.
- A deallocation without a matching allocation.
Nonaggregated columns show data for the first event in the group when the events are grouped. You can use your mouse to resize, hide, and rearrange columns using standard drag-and-drop commands on table header. To hide the column, resize it to none. To make a column more visible, use the Preferences… dialog.
The Memory Analysis view provides the following features:
- Double-click a particular event in the list, and the Momentics IDE highlights the corresponding source code line (if it exists).
- Click a particular event in the list, the problem is selected, and then the Momentics IDE updates the problem backtrace in Memory Backtrace view.
- Click a column header, and 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 your specific platform copy command), and then the Momentics IDE copies the text representation of the event to the clipboard.
- Double-click on the view header to maximize the view (or return to normal when currently maximized).
- Right-click in the table to open the context menu (see below for descriptions).
- Remove Events - remove (by filtering) the current events from the view. Enabled when running.
- Start/Stop memory tracing - Start or stop tracing.
- Open Filter Dialog - open the Filter dialog (see below for descriptions). This item is disabled when the view is synchronized with the editor selection; the Momentics IDE uses the editor filter for this situation.
- Synchronize with Editor Selection - when enabled, the view shows the selection details from the editor allocations page, and uses the editor filters.
- Prevent Auto-Refresh - don't automatically perform a refresh. Enabled when running.
- Refresh - update the data in the view.
- View Menu - open the view menu (see description below).
- Minimize - minimize the view.
- Maximize - maximize the view (or return to normal when currently maximized).
- Filter... - opens the traces filter.
- Find matching event
- Up to Event - show only events up to this current event (by time occurrence).
- From Event - show only events from this event (by time occurrence).
- Matching with Event - show only this event and the matching event (the allocation and deallocation pair).
- Same pointer - show only events that have the same pointer.
- Same size - show only events that have same size of allocation.
- Same band - show only events that are allocated in the same band.
- Same backtrace - show only events with the same allocation backtrace.
- Show All - reset the filter (show all events).
- None - no grouping is performed in the view.
- Kind - group by allocation kind (such as malloc, calloc, and so on)
- Size - group by the requested size.
- Band Size - group by band size (events from the nonband allocator aren't grouped).
- Pointer - group by the same pointer.
- Backtrace - group events with the same backtrace under one group. For the group row, columns show the value of the first entry.
- Thread - group by thread ID.
- Show Backtrace - activate the Memory Backtrace view and show the current backtrace in the view.
- Show Source - show the context menu and double-click to select an event source location.
- Preferences... - open the view Preferences dialog to set the column selection and order.
Memory Events Filter
The Memory Events filter lets you filter a large amount of data to find specific events you are interested in. You can open the Memory Events filter from the Filter… action from Memory Events view.
|Hide matching allocation/deallocation pair||Show outstanding allocations when enabled (some might be memory leaks).|
|Show only events for retained objects||Hide all historical allocations and deallocations; only show events for recent allocations and deallocations for a given pointer.|
|Requested Size Range||Set a filter for the range (or a single value) of the requested allocation size (in bytes).|
|Band Size||Set a filter for the band size. All allocations that didn't band for a given size would be hidden.|
|Pointer||Set the allocation pointer or range.|
|Memory Events Kind||Select only events generated by specific functions.|
|Backtrace Id||Set automatically when the Show only same backtrace quick filter is used.|
|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 when allocation or deallocation occurred.|
Memory Events Preferences
Memory Events Preferences lets you control the look of the Memory Events view. You can select the columns you want to see in the view, as well as some other preferences. You can open the view preferences from global preferences (Window > Preferences… > QNX > Memory Analysis > Memory Events 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 that 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 events
To view statistics for memory events (by allocation kind):
- Right-click anywhere on the table to open the context menu.
- Select Preferences…
- In the Preferences dialog, select the options Expand, Kind, Average Size, Max Size, and Count columns, and deselect all of the other options.
- Click OK.
Right-click, and then select Group
By > Kind.
Events are grouped by the kind, as in example shown above. The column Count shows the number of events in the group. The nonaggregated columns show the value of the first problem in the group.
Similar statistics by size can be obtained by selecting Group By > Band Size (and then by adding the Actual Size column using Preferences…).
And you can obtain statistics by its backtrace by selecting Group By > Backtrace.
Last modified: 2015-07-24