Is there a way to retrieve memory pressure information from macOS using Swift or C/C++?
In Activity Monitor, there’s a chart labeled “Memory Pressure” which provides a discrete metric of RAM usage:
Green = system memory usage is fine
Yellow = moderate pressure
Red = high memory pressure
I’d like to know how to programmatically access this metric.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is there any way to retrieve the memory pressure percentage using native libraries?
When I run the memory-pressure command, I can see the percentage of free memory, but I’d like to retrieve the same information using a native library.
Topic:
Programming Languages
SubTopic:
Swift
When I run this command, the value looks a bit strange.
Sometimes it returns 0, and other times it shows unexpected numbers like 1725 or 1012.
What exactly does this information represent?
I just want to retrieve one of the three possibles values for the memory pressure information (ok, warning, critical).
Topic:
App & System Services
SubTopic:
Core OS