17 #ifndef _MITK_MEMORY_UTILITIES_H_
18 #define _MITK_MEMORY_UTILITIES_H_
35 static size_t GetProcessMemoryUsage();
40 static size_t GetTotalSizeOfPhysicalRam();
52 template <
typename ElementType>
58 ElementType *data =
nullptr;
61 data =
new ElementType[numberOfElements];
67 if ((data ==
nullptr) && (noThrow ==
false))
69 throw itk::MemoryAllocationError(__FILE__, __LINE__,
"Failed to allocate memory.", ITK_LOCATION);
78 template <
typename ElementType>
89 static int ReadStatmFromProcFS(
90 int *size,
int *res,
int *shared,
int *text,
int *sharedLibs,
int *stack,
int *dirtyPages);
static void DeleteElements(ElementType *elements)
DataCollection - Class to facilitate loading/accessing structured data.
static ElementType * AllocateElements(vcl_size_t numberOfElements, bool noThrow=false)