RTI Connext Modern C++ API Version 7.3.0
|
Monitor memory allocations done by the middleware on the native heap. More...
Classes | |
struct | rti::util::heap_monitoring::SnapshotOutputFormat_def |
Specify the format of the output of the snapshot. RTI Connext. More... | |
struct | rti::util::heap_monitoring::SnapshotContentFormat_def |
Bitmap used to decide which information of the snapshot will be displayed. More... | |
class | rti::util::heap_monitoring::HeapMonitoringParams |
Input parameters for enabling heap monitoring. They will be used for configuring the format of the snapshot. More... | |
Typedefs | |
typedef dds::core::safe_enum< SnapshotOutputFormat_def > | rti::util::heap_monitoring::SnapshotOutputFormat |
Specify the format of the output of the snapshot. More... | |
typedef dds::core::safe_enum< SnapshotContentFormat_def > | rti::util::heap_monitoring::SnapshotContentFormat |
Bitmap used to decide which information of the snapshot will be displayed. More... | |
Functions | |
bool | rti::util::heap_monitoring::enable () |
Starts monitoring the heap memory used by RTI Connext. More... | |
bool | rti::util::heap_monitoring::enable (const HeapMonitoringParams ¶ms) |
Starts monitoring the heap memory used by RTI Connext with params. More... | |
void | rti::util::heap_monitoring::disable () |
Stops monitoring the heap memory used by RTI Connext. More... | |
bool | rti::util::heap_monitoring::pause () |
Pauses heap monitoring. More... | |
bool | rti::util::heap_monitoring::resume () |
Resumes heap monitoring. More... | |
bool | rti::util::heap_monitoring::take_snapshot (const std::string &filename, bool print_details=false) |
Saves the current heap memory usage in a file. More... | |
Monitor memory allocations done by the middleware on the native heap.
RTI Connext allows you to monitor the memory allocations done by the middleware on the native heap. This feature can be used to analyze and debug unexpected memory growth.
After heap_monitoring::enable() is called, you may invoke heap_monitoring::take_snapshot() to save the current heap memory usage to a file. By comparing two snapshots, you can tell if new memory has been allocated and, in many cases, where.
typedef dds::core::safe_enum<SnapshotOutputFormat_def> rti::util::heap_monitoring::SnapshotOutputFormat |
Specify the format of the output of the snapshot.
typedef dds::core::safe_enum<SnapshotContentFormat_def> rti::util::heap_monitoring::SnapshotContentFormat |
Bitmap used to decide which information of the snapshot will be displayed.
bool rti::util::heap_monitoring::enable | ( | ) |
Starts monitoring the heap memory used by RTI Connext.
This function must be called before any other function in the RTI Connext library is called.
Once heap monitoring is enabled, you can take heap snapshots by using heap_monitoring::take_snapshot().
Use this method only for debugging purposes, since it may introduce a significant performance impact.
bool rti::util::heap_monitoring::enable | ( | const HeapMonitoringParams & | params | ) |
Starts monitoring the heap memory used by RTI Connext with params.
Perfoms the same function as heap_monitoring::enable() except that it also provides the values in params. Those values will set the format used in the snapshot heap_monitoring::take_snapshot().
void rti::util::heap_monitoring::disable | ( | ) |
Stops monitoring the heap memory used by RTI Connext.
This method must be the last method called from RTI Connext.
bool rti::util::heap_monitoring::pause | ( | ) |
Pauses heap monitoring.
New memory allocations will not be monitored and they will not appear in the snapshot generated by heap_monitoring::take_snapshot().
bool rti::util::heap_monitoring::resume | ( | ) |
Resumes heap monitoring.
bool rti::util::heap_monitoring::take_snapshot | ( | const std::string & | filename, |
bool | print_details = false |
||
) |
Saves the current heap memory usage in a file.
After heap_monitoring::enable() is called, you may invoke this method periodically to save the current heap memory usage to a file.
By comparing two snapshots, you can tell if new memory has been allocated and in many cases where. This is why this operation can be used to debug unexpected memory growth.
The format of a snapshot is as follows:
First, there is a memory usage summary like this:
After the previous summary, and only if you set the parameter print_details to true, the method will print the details of every single outstanding heap allocation done by RTI Connext. For example:
filename | <<in>>. Name of file in which to store the snapshot. |
print_details | <<in>>. Indicates if the snapshot will contain only the memory usage summary or the details of the individual allocations. |