Open CASCADE Technology
7.5.0
|
This class provide information about memory utilized by current process. This information includes: More...
#include <OSD_MemInfo.hxx>
Public Types | |
enum | Counter { MemPrivate = 0, MemVirtual, MemWorkingSet, MemWorkingSetPeak, MemSwapUsage, MemSwapUsagePeak, MemHeapUsage, MemCounter_NB } |
Public Member Functions | |
OSD_MemInfo (const Standard_Boolean theImmediateUpdate=Standard_True) | |
Create and initialize. By default all countes are active. More... | |
Standard_Boolean | IsActive (const OSD_MemInfo::Counter theCounter) const |
Return true if the counter is active. More... | |
void | SetActive (const Standard_Boolean theActive) |
Set all counters active. The information is collected for active counters. More... | |
void | SetActive (const OSD_MemInfo::Counter theCounter, const Standard_Boolean theActive) |
Set the counter active. The information is collected for active counters. More... | |
void | Clear () |
Clear counters. More... | |
void | Update () |
Update counters. More... | |
TCollection_AsciiString | ToString () const |
Return the string representation for all available counter. More... | |
Standard_Size | Value (const OSD_MemInfo::Counter theCounter) const |
Return value of specified counter in bytes. Notice that NOT all counters are available on various systems. Standard_Size(-1) means invalid (unavailable) value. More... | |
Standard_Size | ValueMiB (const OSD_MemInfo::Counter theCounter) const |
Return value of specified counter in MiB. Notice that NOT all counters are available on various systems. Standard_Size(-1) means invalid (unavailable) value. More... | |
Standard_Real | ValuePreciseMiB (const OSD_MemInfo::Counter theCounter) const |
Return floating value of specified counter in MiB. Notice that NOT all counters are available on various systems. Standard_Real(-1) means invalid (unavailable) value. More... | |
Static Public Member Functions | |
static TCollection_AsciiString | PrintInfo () |
Return the string representation for all available counter. More... | |
Protected Member Functions | |
Standard_Boolean | hasValue (const OSD_MemInfo::Counter theCounter) const |
Return true if the counter is active and the value is valid. More... | |
This class provide information about memory utilized by current process. This information includes:
Notice that none of these counters can be used as absolute measure of application memory consumption!
User should analyze all values in specific case to make correct decision about memory (over)usage. This is also prefferred to use specialized tools to detect memory leaks.
This also means that these values should not be used for intellectual memory management by application itself.
enum OSD_MemInfo::Counter |
OSD_MemInfo::OSD_MemInfo | ( | const Standard_Boolean | theImmediateUpdate = Standard_True | ) |
Create and initialize. By default all countes are active.
void OSD_MemInfo::Clear | ( | ) |
Clear counters.
|
inlineprotected |
Return true if the counter is active and the value is valid.
|
inline |
Return true if the counter is active.
|
static |
Return the string representation for all available counter.
void OSD_MemInfo::SetActive | ( | const Standard_Boolean | theActive | ) |
Set all counters active. The information is collected for active counters.
theActive | state for counters |
|
inline |
Set the counter active. The information is collected for active counters.
theCounter | type of counter |
theActive | state for the counter |
TCollection_AsciiString OSD_MemInfo::ToString | ( | ) | const |
Return the string representation for all available counter.
void OSD_MemInfo::Update | ( | ) |
Update counters.
Standard_Size OSD_MemInfo::Value | ( | const OSD_MemInfo::Counter | theCounter | ) | const |
Return value of specified counter in bytes. Notice that NOT all counters are available on various systems. Standard_Size(-1) means invalid (unavailable) value.
Standard_Size OSD_MemInfo::ValueMiB | ( | const OSD_MemInfo::Counter | theCounter | ) | const |
Return value of specified counter in MiB. Notice that NOT all counters are available on various systems. Standard_Size(-1) means invalid (unavailable) value.
Standard_Real OSD_MemInfo::ValuePreciseMiB | ( | const OSD_MemInfo::Counter | theCounter | ) | const |
Return floating value of specified counter in MiB. Notice that NOT all counters are available on various systems. Standard_Real(-1) means invalid (unavailable) value.