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 )
31 using NTSTATUS = LONG;
59 #if defined( WIN32 ) || defined( _WIN32 )
63 WindowsMemoryUsageObserver();
65 virtual ~WindowsMemoryUsageObserver();
68 virtual MemoryLoadType GetMemoryUsage();
71 #if defined( SUPPORT_TOOLHELP32 )
72 typedef NTSTATUS ( WINAPI * PZwQuerySystemInformation )(UINT, PVOID, ULONG, PULONG);
77 PZwQuerySystemInformation ZwQuerySystemInformation;
78 #endif // defined(SUPPORT_TOOLHELP32)
80 #endif // defined(WIN32) || defined(_WIN32)
83 class ITKCommon_EXPORT LinuxMemoryUsageObserver:
public MemoryUsageObserverBase
87 virtual ~LinuxMemoryUsageObserver();
88 virtual MemoryLoadType GetMemoryUsage();
93 #if defined( __APPLE__ )
94 class ITKCommon_EXPORT MacOSXMemoryUsageObserver:
public MemoryUsageObserverBase
98 ~MacOSXMemoryUsageObserver()
override;
99 MemoryLoadType GetMemoryUsage()
override;
104 #if defined( __SUNPRO_CC ) || defined ( __sun__ )
105 class ITKCommon_EXPORT SunSolarisMemoryUsageObserver:
public MemoryUsageObserverBase
109 virtual ~SunSolarisMemoryUsageObserver();
110 virtual MemoryLoadType GetMemoryUsage();
112 #endif // Sun Solaris
115 #if !defined( WIN32 ) && !defined( _WIN32 )
125 #if defined( ITK_HAS_MALLINFO )
134 virtual ~MallinfoMemoryUsageObserver();
135 virtual MemoryLoadType GetMemoryUsage();
138 #endif // !defined(WIN32) && !defined(_WIN32)
149 #if defined( WIN32 ) || defined( _WIN32 )
150 public WindowsMemoryUsageObserver
151 #elif defined( __linux__ )
152 public LinuxMemoryUsageObserver
153 #elif defined( __SUNPRO_CC ) || defined ( __sun__ )
154 public SunSolarisMemoryUsageObserver
155 #elif defined( __APPLE__ )
156 public MacOSXMemoryUsageObserver
157 #elif defined( __FreeBSD__ ) || defined( __OpenBSD__ )
160 public MallinfoMemoryUsageObserver
169 #endif // itkMemoryUsageObserver_h
unsigned long SizeValueType
SizeValueType MemoryLoadType
Provides the memory usage of the process.