OpenMS  2.6.0
Classes | Static Public Member Functions | List of all members
SysInfo Class Reference

Some functions to get system information. More...

#include <OpenMS/SYSTEM/SysInfo.h>

Classes

struct  MemUsage
 A convenience class to report either absolute or delta (between two timepoints) RAM usage. More...
 

Static Public Member Functions

static bool getProcessMemoryConsumption (size_t &mem_virtual)
 
static bool getProcessPeakMemoryConsumption (size_t &mem_virtual)
 

Detailed Description

Some functions to get system information.

Supports current memory and peak memory consumption.

Member Function Documentation

◆ getProcessMemoryConsumption()

static bool getProcessMemoryConsumption ( size_t &  mem_virtual)
static

Get memory consumption in KiloBytes (KB) On Windows, this is equivalent to 'Peak Working Set (Memory)' in Task Manager. On other OS this might be very unreliable, depending on operating system and kernel version.

Parameters
mem_virtualTotal virtual memory currently allocated by this process
Returns
True on success, false otherwise. If false is returned, then mem_virtual is set to 0.

◆ getProcessPeakMemoryConsumption()

static bool getProcessPeakMemoryConsumption ( size_t &  mem_virtual)
static

Get peak memory consumption in KiloBytes (KB) On Windows, this is equivalent to 'Working Set (Memory)' in Task Manager. On other OS this might be very unreliable, depending on operating system and kernel version.

Parameters
mem_virtualTotal virtual memory allocated by this process
Returns
True on success, false otherwise. If false is returned, then mem_virtual is set to 0.