On macOS, Apple's built-in Activity Monitor.app shows a 'Memory', 'Real Mem', 'Private Mem' and 'Shared Mem' column. How can we determine the methods they use to determine these amounts of memory for each process running on the system?


% sw_vers
ProductName:		macOS
ProductVersion:		15.5
BuildVersion:		24F74


% otool -L /System/Applications/Utilities/Activity\ Monitor.app/Contents/MacOS/Activity\ Monitor
/System/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor:
	/System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication (compatibility version 1.0.0, current version 64570.35.1)
	/System/Library/PrivateFrameworks/SafeEjectGPU.framework/Versions/A/SafeEjectGPU (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/PrivateFrameworks/RemoteServiceDiscovery.framework/Versions/A/RemoteServiceDiscovery (compatibility version 1.0.0, current version 172.100.9)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 3502.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 24.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61439.120.27)
	/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation (compatibility version 1.0.0, current version 55290.0.0)
	/System/Library/PrivateFrameworks/Suggestions.framework/Versions/A/Suggestions (compatibility version 1.0.0, current version 333.0.0)
	/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Metal.framework/Versions/A/Metal (compatibility version 1.0.0, current version 368.12.0)
	/System/Library/PrivateFrameworks/NetworkStatistics.framework/Versions/A/NetworkStatistics (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers (compatibility version 1.0.0, current version 709.0.0)
	/System/Library/PrivateFrameworks/AssetCacheServicesExtensions.framework/Versions/A/AssetCacheServicesExtensions (compatibility version 1.0.0, current version 135.0.0)
	/System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport (compatibility version 1.0.0, current version 15131.0.0)
	/usr/lib/libIOReport.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libquit.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libsysmon.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libsystemstats.dylib (compatibility version 1.0.0, current version 498.120.2)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1351.0.0)
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2575.60.5)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 3502.0.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1889.5.3)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)