Skip to content

Conversation

@pvlltvk
Copy link

@pvlltvk pvlltvk commented Dec 17, 2025

Hi!

Please take a look at the PR, it add support for the Percpu field from /proc/meminfo which is available on modern linux based OS.

Closes #1203

This commit adds support for the `Percpu` field from `/proc/meminfo`.
Percpu indicates the memory allocated for per-cpu objects and can be
helpful in some cases:
https://jbn1233.medium.com/linux-percpu-memory-leak-96293a03ad28
@shirou
Copy link
Owner

shirou commented Dec 18, 2025

Thank you for your contribution. The percpu field appears to be available only on Linux. Since gopsutil aims to be a multi-platform library, we cannot add it to the common VirtualMemoryStat struct.

However, we provide ExVirtualMemory for platform-specific information. Please update the implementation to use this struct, and we can proceed with accepting the change.

@pvlltvk
Copy link
Author

pvlltvk commented Dec 18, 2025

Thanks, I moved it to the ExVirtualMemory, please take a look now.

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.

meminfo percpu add please

2 participants