JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Data Structures | Public Types | Static Public Member Functions
MemoryUtility Class Reference

#include <MemoryUtility.h>

Data Structures

class  MemorySize
 

Public Types

typedef unsigned long long MemoryT
 

Static Public Member Functions

static MemorySize totalRam ()
 
static MemorySize sysRamUsage ()
 
static MemorySize procRamUsage ()
 
static MemorySize remainingRam ()
 
static double getFreeRam ()
 
static std::string getRamUsage ()
 
static std::string humanReadablePercent (double num)
 

Detailed Description

This class retrieves information about the host system and programs memory consumption.

Member Typedef Documentation

◆ MemoryT

typedef unsigned long long MemoryUtility::MemoryT

Member Function Documentation

◆ getFreeRam()

double MemoryUtility::getFreeRam ( )
static

Calculates the percentage of free memory.

Returns
the percentage of free memory in [0,1]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRamUsage()

std::string MemoryUtility::getRamUsage ( )
static

Creates a human readable memory usage report.

Returns
the report as string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ humanReadablePercent()

std::string MemoryUtility::humanReadablePercent ( double  num)
static

Helper function to translate a percentage in [0,1] to human readable format in "[0,100]%"

Returns
human readable percentage
Here is the caller graph for this function:

◆ procRamUsage()

MemoryUtility::MemorySize MemoryUtility::procRamUsage ( )
static

Retrieves the program memory usage of the system

Returns
the program memory usage as MemorySize
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remainingRam()

MemoryUtility::MemorySize MemoryUtility::remainingRam ( )
static

Retrieves the remaining free memory of the system

Returns
the remaining free memory as MemorySize

◆ sysRamUsage()

MemoryUtility::MemorySize MemoryUtility::sysRamUsage ( )
static

Retrieves the total memory usage of the system

Returns
the total memory usage as MemorySize
Here is the caller graph for this function:

◆ totalRam()

MemoryUtility::MemorySize MemoryUtility::totalRam ( )
static

Retrieves the total installed memory of the system

Returns
the total system memory as MemorySize
Here is the caller graph for this function:

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