Observe changes in memory usage (allocations and deallocations)
It is important for you to know when and where memory is being consumed within an application. The Memory Analysis tool includes several views that use the trace data from the Memory Analysis session to help extract and visually show this information to determine memory usage (allocation and deallocation metrics). Showing this information using various charts helps you observe the changes in memory usage
The Momentics IDE includes the following tabs to help you observe changes in memory over time:
To access these tabs:
- Select Window > Show View > Other.
- Select QNX System Information > Malloc Information.
- Click OK.
To begin to view data on your graphs, you need to set logging for the target, and you need to select an initial process from the Target Navigator view.
These charts show the memory usage and the volume of memory events over time (the allocation and deallocation of memory). These views reflect the current state of the active editor and active editor pane. You can select an area of interest in any of the charts; then, using the right-click menu, zoom in to show only that range of events to quickly isolate areas of interest due to abnormal system activity.
Inspect outstanding allocations
Outstanding allocations are memory allocations that are currently active (that is, not freed). Sometimes, they are valid allocations, and sometimes they are implicit memory leaks. Since an allocation pointer is used, it can't be detected as a memory leak; to validate that an allocation is required, you have to manually inspect it.
To manually inspect outstanding allocations:
- Open the Memory Events view and click a desired session to populate it.
- Select the Filter… option from the context menu.
- Select the Hide matching allocation/deallocation pair option and click OK.
- Select the Group By Backtrace option from the context menu.
- Review the results (only those allocations that remain in memory, or were in memory at the moment of the exit).
Select one allocation from the table.
The Memory Backtrace view becomes populated with the current stack trace for the selected event.
- Optional: To inspect allocations that only occurred between certain time intervals, use the Quick Filter option from the context menu to restrict the events range.
This graph shows the total allocation of memory within your program over time for the selected process.
If you compare it to the Overview History tab, you can see the trend of how memory is being allocated within your program.
This graph shows the changes to the allocation of memory within your program over time for the selected process. From this type of graph, you can observe which band(s) has the most activity.
This graph shows the changes to the deallocation of memory within your program over time for the selected process from the Target Navigator view. From this type of graph, you can observe which band(s) has the least activity.
Outstanding allocation deltas
This graph shows the differences between the memory that was allocated and deallocated for the selected process; it shows a summary of the free memory. From this graph, you can observe which band(s) might be leaking memory, and by how much.
Last modified: 2015-07-24