memInfo Class Reference

Memory usage information for the process running this object. More...

Public Member Functions

 memInfo ()
 Construct null. More...
 
 ~memInfo ()
 Destructor. More...
 
const memInfoupdate ()
 Parse /proc/<pid>/status. More...
 
int peak () const
 Access the stored peak memory (VmPeak in /proc/<pid>/status) More...
 
int size () const
 Access the stored memory size (VmSize in /proc/<pid>/status) More...
 
int rss () const
 Access the stored rss value (VmRSS in /proc/<pid>/status) More...
 
bool valid () const
 True if the memory information appears valid. More...
 

Friends

Istreamoperator>> (Istream &, memInfo &)
 Read peak/size/rss from stream. More...
 
Ostreamoperator<< (Ostream &, const memInfo &)
 Write peak/size/rss to stream. More...
 

Detailed Description

Memory usage information for the process running this object.

Note
Uses the information from /proc/<pid>/status
Source files

Definition at line 61 of file memInfo.H.

Constructor & Destructor Documentation

◆ memInfo()

memInfo ( )

Construct null.

Definition at line 30 of file memInfo.C.

References memInfo::update().

Here is the call graph for this function:

◆ ~memInfo()

~memInfo ( )

Destructor.

Definition at line 42 of file memInfo.C.

Member Function Documentation

◆ update()

const Foam::memInfo & update ( )

Parse /proc/<pid>/status.

Definition at line 48 of file memInfo.C.

References ISstream::getLine(), IOstream::good(), Foam::name(), and Foam::pid().

Referenced by memInfo::memInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ peak()

int peak ( ) const
inline

Access the stored peak memory (VmPeak in /proc/<pid>/status)

The value is stored from the previous update()

Definition at line 96 of file memInfo.H.

◆ size()

int size ( ) const
inline

Access the stored memory size (VmSize in /proc/<pid>/status)

The value is stored from the previous update()

Definition at line 103 of file memInfo.H.

Referenced by indexedOctree< Foam::treeDataFace >::indexedOctree().

Here is the caller graph for this function:

◆ rss()

int rss ( ) const
inline

Access the stored rss value (VmRSS in /proc/<pid>/status)

The value is stored from the previous update()

Definition at line 110 of file memInfo.H.

◆ valid()

bool valid ( ) const

True if the memory information appears valid.

Definition at line 82 of file memInfo.C.

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
memInfo  
)
friend

Read peak/size/rss from stream.

◆ operator<<

Ostream& operator<< ( Ostream ,
const memInfo  
)
friend

Write peak/size/rss to stream.


The documentation for this class was generated from the following files: