RTI Connext Modern C++ API
Version 6.0.0
|
Unsupported APIs used by examples in the RTI Connext distribution as well as in rtiddsgen-generated examples. More...
Functions | |
void | rti::util::sleep (const dds::core::Duration &durationIn) |
Block the calling thread for the specified duration. | |
bool | rti::util::heap_monitoring::enable () |
Starts monitoring the heap memory used by RTI Connext. | |
void | rti::util::heap_monitoring::disable () |
Stops monitoring the heap memory used by RTI Connext. | |
bool | rti::util::heap_monitoring::pause () |
Pauses heap monitoring. | |
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. | |
Unsupported APIs used by examples in the RTI Connext distribution as well as in rtiddsgen-generated examples.
void rti::util::sleep | ( | const dds::core::Duration & | durationIn | ) |
Block the calling thread for the specified duration.
Note that the achievable resolution of sleep is OS-dependent. That is, do not assume that you can sleep for 1 nanosecond just because you can specify a 1-nanosecond sleep duration via the API. The sleep resolution on most operating systems is usually 10 ms or greater.
durationIn | <<in>> Sleep duration. |
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 rti::util::heap::take_snapshot().
Use this method only for debugging purposes, as it may introduce a significant performance impact.
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 rti::util::heap::take_snapshot().
bool rti::util::heap_monitoring::resume | ( | ) |
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 rti::util::heap::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. |