Medical Imaging Interaction Toolkit  2018.4.99-37cb6b01
Medical Imaging Interaction Toolkit
mitk::MemoryUtilities Class Reference

#include <mitkMemoryUtilities.h>

Static Public Member Functions

static vcl_size_t GetProcessMemoryUsage ()
static vcl_size_t GetTotalSizeOfPhysicalRam ()
template<typename ElementType >
static ElementType * AllocateElements (vcl_size_t numberOfElements, bool noThrow=false)
template<typename ElementType >
static void DeleteElements (ElementType *elements)

Static Protected Member Functions

static int ReadStatmFromProcFS (int *size, int *res, int *shared, int *text, int *sharedLibs, int *stack, int *dirtyPages)

Detailed Description

Definition at line 21 of file mitkMemoryUtilities.h.

Member Function Documentation

◆ AllocateElements()

template<typename ElementType >
static ElementType* mitk::MemoryUtilities::AllocateElements ( vcl_size_t  numberOfElements,
bool  noThrow = false 

Allocates an array of a given number of elements. Each element has a size of sizeof(ElementType). The function returns nullptr, if the array could not be allocated.

numberOfElementsthe number of elements of the array
noThrowif set to false, an exception is thrown if memory allocation fails. If set to true, a itk::MemoryAllocationError is thrown
a pointer to the allocated array. If noThrow == true, nullptr is returned if memory allocation failed.

Definition at line 49 of file mitkMemoryUtilities.h.

◆ DeleteElements()

template<typename ElementType >
static void mitk::MemoryUtilities::DeleteElements ( ElementType *  elements)

Deletes an array of elements previously allocated by AllocateElements.

elementsthe array to delete. Not that nullptr is an accepted value.

Definition at line 75 of file mitkMemoryUtilities.h.

◆ GetProcessMemoryUsage()

static vcl_size_t mitk::MemoryUtilities::GetProcessMemoryUsage ( )

Returns the memory usage of the current process in bytes. On linux, this refers to the virtual memory allocated by the process (the VIRT column in top). On windows, this refery to the size in bytes of the working set pages (the "Speicherauslastung" column in the task manager).

◆ GetTotalSizeOfPhysicalRam()

static vcl_size_t mitk::MemoryUtilities::GetTotalSizeOfPhysicalRam ( )

Returns the total size of phyiscal memory in bytes

◆ ReadStatmFromProcFS()

static int mitk::MemoryUtilities::ReadStatmFromProcFS ( int *  size,
int *  res,
int *  shared,
int *  text,
int *  sharedLibs,
int *  stack,
int *  dirtyPages 

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