13 #ifndef _MITK_MEMORY_UTILITIES_H_ 14 #define _MITK_MEMORY_UTILITIES_H_ 31 static size_t GetProcessMemoryUsage();
36 static size_t GetTotalSizeOfPhysicalRam();
48 template <
typename ElementType>
54 ElementType *data =
nullptr;
57 data =
new ElementType[numberOfElements];
63 if ((data ==
nullptr) && (noThrow ==
false))
65 throw itk::MemoryAllocationError(__FILE__, __LINE__,
"Failed to allocate memory.", ITK_LOCATION);
74 template <
typename ElementType>
77 if (elements !=
nullptr)
85 static int ReadStatmFromProcFS(
86 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)