Skip to content

feat(mem): Add support for Percpu - #1972

Merged
shirou merged 2 commits into
shirou:masterfrom
pvlltvk:feat/meminfo_percpu
Dec 21, 2025
Merged

feat(mem): Add support for Percpu#1972
shirou merged 2 commits into
shirou:masterfrom
pvlltvk:feat/meminfo_percpu

Conversation

@pvlltvk

@pvlltvk pvlltvk commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

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

shirou commented Dec 18, 2025

Copy link
Copy Markdown
Owner

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

pvlltvk commented Dec 18, 2025

Copy link
Copy Markdown
Contributor Author

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

@shirou shirou left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for your update and great contribution. LGTM!

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

2 participants