shirou / gopsutil

psutil for golang
Other
10.68k stars 1.59k forks source link

Expose MemCommit info for Windows #1719

Closed n4nn31355 closed 1 month ago

n4nn31355 commented 1 month ago

Is your feature request related to a problem? Please describe. Windows basically doesn't allow to overcommit memory, and applications most times start to fail when there is enough physical memory available, so this is a critical metric for the platform.

Describe the solution you'd like Expose CommitTotal and CommitLimit metrics. It probably makes sense to also expose ullTotalPageFile and ullAvailPageFile, but I am less concerned about that. This data is already being requested from the system, but not exposed.

Describe alternatives you've considered [A clear and concise description of any alternative solutions or features you've considered.]

Additional context Example of the difference between Used/Commited memory in Windows Task Manager: image Stats doc: https://learn.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-performance_information#members https://learn.microsoft.com/en-us/windows/win32/memory/memory-performance-information#system-memory-performance-information