Loading...
Searching...
No Matches
memInfo Class Reference

Memory usage information for the current process, and the system memory that is free. More...

#include <memInfo.H>

Public Member Functions

 memInfo ()
 Construct and populate with values.
bool good () const noexcept
 True if the memory information appears valid.
int64_t peak () const noexcept
 Peak memory at last update - (VmPeak in /proc/PID/status).
int64_t size () const noexcept
 Memory size at last update - (VmSize in /proc/PID/status).
int64_t rss () const noexcept
 Resident set size at last update - (VmRSS in /proc/PID/status).
int64_t free () const noexcept
 System memory free (MemFree in /proc/meminfo).
void clear () noexcept
 Reset to zero.
const memInfoupdate ()
 Update according to /proc/PID/status and /proc/memory contents.
void writeEntries (Ostream &os) const
 Write mem-info as dictionary entries.
void writeEntry (const word &keyword, Ostream &os) const
 Write mem-info as dictionary.

Static Public Member Functions

static bool supported ()
 True if memory information appears to be supported.

Friends

Ostreamoperator<< (Ostream &os, const memInfo &m)
 Write peak/size/rss to stream.

Detailed Description

Memory usage information for the current process, and the system memory that is free.

Note
Uses the information from /proc/PID/status and from /proc/meminfo
Source files

Definition at line 58 of file memInfo.H.

Constructor & Destructor Documentation

◆ memInfo()

memInfo ( )

Construct and populate with values.

Definition at line 58 of file memInfo.C.

Referenced by operator<<.

Here is the caller graph for this function:

Member Function Documentation

◆ supported()

bool supported ( )
static

True if memory information appears to be supported.

Definition at line 43 of file memInfo.C.

References is_supported().

Here is the call graph for this function:

◆ good()

bool good ( ) const
noexcept

True if the memory information appears valid.

Definition at line 71 of file memInfo.C.

References Foam::noexcept.

◆ peak()

int64_t peak ( ) const
inlinenoexcept

Peak memory at last update - (VmPeak in /proc/PID/status).

Definition at line 119 of file memInfo.H.

References Foam::noexcept.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ size()

int64_t size ( ) const
inlinenoexcept

Memory size at last update - (VmSize in /proc/PID/status).

Definition at line 124 of file memInfo.H.

References Foam::noexcept.

Referenced by indexedOctree< Type >::indexedOctree(), and Foam::operator<<().

Here is the caller graph for this function:

◆ rss()

int64_t rss ( ) const
inlinenoexcept

Resident set size at last update - (VmRSS in /proc/PID/status).

Definition at line 129 of file memInfo.H.

References Foam::noexcept.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ free()

int64_t free ( ) const
inlinenoexcept

System memory free (MemFree in /proc/meminfo).

Definition at line 134 of file memInfo.H.

References Foam::noexcept.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ clear()

void clear ( )
noexcept

Reset to zero.

Definition at line 77 of file memInfo.C.

References Foam::noexcept.

◆ update()

const Foam::memInfo & update ( )

Update according to /proc/PID/status and /proc/memory contents.

Definition at line 222 of file memInfo.C.

References clear().

Here is the call graph for this function:

◆ writeEntries()

void writeEntries ( Ostream & os) const

Write mem-info as dictionary entries.

Definition at line 230 of file memInfo.C.

References os().

Referenced by operator<<, and writeEntry().

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

◆ writeEntry()

void writeEntry ( const word & keyword,
Ostream & os ) const

Write mem-info as dictionary.

Definition at line 240 of file memInfo.C.

References os(), and writeEntries().

Referenced by operator<<.

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

◆ operator<<

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

Write peak/size/rss to stream.

References memInfo(), os(), writeEntries(), and writeEntry().


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