Skip to content

Conversation

@atoulme
Copy link
Contributor

@atoulme atoulme commented Nov 20, 2025

This adds supports on Darwin system to expose the memory pressure value of the system.

This value is a percentage indicating the memory pressure of the system as a whole, computed by the kernel.

This is based off prior art:
exelban/stats#1453
https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/osfmk/arm/commpage/commpage.c#L338
https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/osfmk/vm/vm_pageout.c#L1878

Copy link

@anelson-splunk anelson-splunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@a25salas
Copy link

Excellent!

Copy link
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time to implement this feature. I really appreciate your effort and contribution.

However, gopsutil aims to be a multi-platform library. We generally do not accept features that are specific to a single OS. At a minimum, new features need to be supported on Windows and Linux as well. And keeping strict alignment with Python's psutil API. Since this feature is macOS-specific and not part of the original psutil, adding it would deviate from our project goals.

Regrettably, I have to reject this PR. I hope you understand our position on maintaining a consistent scope for the library. Thanks again.

@atoulme
Copy link
Contributor Author

atoulme commented Nov 29, 2025

Not a problem. Great to get validation that this might be useful on Mac OS. We will directly implement this feature in the hostmetricsreceiver of the OpenTelemetry Collector for Mac OS X support only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants