Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

SystemInfo.MacMemoryHostStatistics

Queries memory host statistics for macOS and iOS.

Component Version macOS Windows Linux Server iOS SDK
SystemInfo 14.3 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ✅ Yes
MBS( "SystemInfo.MacMemoryHostStatistics" )

Parameters

none

Result

Returns JSON or error.

Description

Queries memory host statistics for macOS and iOS.

KeyMeaning
PageSizeThe size of a page in bytes.
FreeCount# of pages free
ActiveCount# of pages active
InactiveCount# of pages inactive
WireCount# of pages wired down
ZeroFillCount# of zero fill pages
Reactivations# of pages reactivated
Pageins# of pageins
Pageouts# of pageouts
Faults# of faults
CopyOnWriteFaults# of copy-on-writes
Lookupsobject cache lookups
Hitsobject cache hits
Purges# of pages purged
PurgeableCount# of pages purgeable
SpeculativeCount# of pages speculative
Decompressions# of pages decompressed
Compressions# of pages compressed
Swapins# of pages swapped in (via compression segments)
Swapouts# of pages swapped out (via compression segments)
CompressorPageCount# of pages used by the compressed pager to hold all the compressed data
ThrottledCount# of pages throttled
ExternalPageCount# of pages that are file-backed (non-swap)
InternalPageCount# of pages that are anonymous
TotalUncompressedPagesInCompressor# of pages (uncompressed) held within the compressor.

You may need to multiple all page counts below with the page size to get size in bytes. Page size is different for Intel vs. Apple Silicon.
The sum of FreeCount and PurgeableCount is the free memory although some software just counts InactiveCount as free as it can be swapped out.

Speculative pages are already accounted for in FreeCount, so SpeculativeCount is the number of "free" pages that are used to hold data that was read speculatively from disk but haven't actually been used by anyone so far.

Examples

Try it:

MBS( "SystemInfo.MacMemoryHostStatistics" )

Example result:
{ "Compressions" : 1985361, "CompressorPageCount" : 149022, "Swapins" : 0, "Hits" : 0, "SpeculativeCount" : 1578, "Purges" : 9833309, "InternalPageCount" : 2359923, "WireCount" : 264103, "ThrottledCount" : 0, "PageSize" : 16384, "InactiveCount" : 1860387, "CopyOnWriteFaults" : 11950752, "ZeroFillCount" : 227376946, "Decompressions" : 909697, "Swapouts" : 0, "TotalUncompressedPagesInCompressor" : 419808, "ExternalPageCount" : 1357433, "Reactivations" : 4341900, "Lookups" : 0, "Pageouts" : 128639, "FreeCount" : 5720, "PurgeableCount" : 827895, "Pageins" : 39849671, "Faults" : 422802459, "ActiveCount" : 1855391 }

Release notes

  • Version 14.3
    • Added SystemInfo.MacMemoryHostStatistics function.

Blog Entries

This function checks for a license.

Created 6th June 2024, last changed 6th June 2024


SystemInfo.MacMajorVersion - SystemInfo.MacMinorVersion