18#ifndef itkMemoryUsageObserver_h
19#define itkMemoryUsageObserver_h
21#include "itkConfigure.h"
27#if defined(WIN32) || defined(_WIN32)
29# define SUPPORT_TOOLHELP32
30# if defined(SUPPORT_TOOLHELP32)
60#if defined(WIN32) || defined(_WIN32)
64 WindowsMemoryUsageObserver();
66 virtual ~WindowsMemoryUsageObserver();
69 virtual MemoryLoadType
73# if defined(SUPPORT_TOOLHELP32)
74 using PZwQuerySystemInformation = NTSTATUS(WINAPI *)(UINT, PVOID, ULONG, PULONG);
77 HMODULE m_hNTLib{
nullptr };
79 PZwQuerySystemInformation ZwQuerySystemInformation{
nullptr };
85class ITKCommon_EXPORT LinuxMemoryUsageObserver :
public MemoryUsageObserverBase
89 ~LinuxMemoryUsageObserver()
override;
91 GetMemoryUsage()
override;
97class ITKCommon_EXPORT MacOSXMemoryUsageObserver :
public MemoryUsageObserverBase
101 ~MacOSXMemoryUsageObserver()
override;
103 GetMemoryUsage()
override;
108#if defined(__SUNPRO_CC) || defined(__sun__)
109class ITKCommon_EXPORT SunSolarisMemoryUsageObserver :
public MemoryUsageObserverBase
113 virtual ~SunSolarisMemoryUsageObserver();
114 virtual MemoryLoadType
120#if !defined(WIN32) && !defined(_WIN32)
131# if defined(ITK_HAS_MALLINFO) || defined(ITK_HAS_MALLINFO2)
140 ~MallinfoMemoryUsageObserver()
override;
142 GetMemoryUsage()
override;
157#if defined(WIN32) || defined(_WIN32)
158 public WindowsMemoryUsageObserver
159#elif defined(__linux__)
160 public LinuxMemoryUsageObserver
161#elif defined(__SUNPRO_CC) || defined(__sun__)
162 public SunSolarisMemoryUsageObserver
163#elif defined(__APPLE__)
164 public MacOSXMemoryUsageObserver
165#elif defined(__FreeBSD__) || defined(__OpenBSD__)
168 public MallinfoMemoryUsageObserver
SizeValueType MemoryLoadType
virtual MemoryLoadType GetMemoryUsage()=0
virtual ~MemoryUsageObserverBase()
Provides the memory usage of the process.
~MemoryUsageObserver() override
MemoryLoadType GetMemoryUsage() override
~SysResourceMemoryUsageObserver() override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType