Medical Imaging Interaction Toolkit  2016.11.0
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 25 of file mitkMemoryUtilities.h.

Member Function Documentation

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

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

Parameters
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
Returns
a pointer to the allocated array. If noThrow == true, NULL is returned if memory allocation failed.

Definition at line 53 of file mitkMemoryUtilities.h.

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

Deletes an array of elements previously allocated by AllocateElements.

Parameters
elementsthe array to delete. Not that NULL is an accepted value.

Definition at line 79 of file mitkMemoryUtilities.h.

vcl_size_t mitk::MemoryUtilities::GetProcessMemoryUsage ( )
static

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).

Definition at line 40 of file mitkMemoryUtilities.cpp.

References ReadStatmFromProcFS().

Referenced by QmitkMemoryUsageIndicatorView::UpdateMemoryUsage().

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

Definition at line 100 of file mitkMemoryUtilities.cpp.

Referenced by GetProcessMemoryUsage().


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