You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python3.8 -c "import psutil; print(psutil.swap_memory())" shows committed memory (physical memory + pagefile/swap). On FreeBSD, it shows swap only as it should be. I believe on Windows it should show swap-only numbers too (psutil is portable, right?).
The text was updated successfully, but these errors were encountered:
On Windows, psutil uses the fields ullTotalPageFile and ullAvailPageFile from MEMORYSTATUSEX but the docs imply those values are associated with the commit limit. To correct using the existing structure, the ullTotalPhys and ullAvailPhys values, respectively, should be subtracted to get swap file usage.
However, MEMORYSTATUSEX only gives a process-level view of memory:
The current committed memory limit for the system or the current process, whichever is smaller, in bytes. To get the system-wide committed memory limit, call GetPerformanceInfo.
This will return a PERFORMANCE_INFORMATION structure. CommitLimit - PhysicalTotal is swap total, and (CommitLimit - CommitTotal) - PhysicalAvailable is swap available.
Summary
Description
python3.8 -c "import psutil; print(psutil.swap_memory())"
shows committed memory (physical memory + pagefile/swap). On FreeBSD, it shows swap only as it should be. I believe on Windows it should show swap-only numbers too (psutil is portable, right?).The text was updated successfully, but these errors were encountered: