Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong swap percent being returned on windows NCPA #807

Closed
etsorbme opened this issue Sep 8, 2021 · 4 comments
Closed

Wrong swap percent being returned on windows NCPA #807

etsorbme opened this issue Sep 8, 2021 · 4 comments
Labels
Milestone

Comments

@etsorbme
Copy link

etsorbme commented Sep 8, 2021

Windows is calculating swap incorrectly. Linux calculates correctly and as expected. I can run python using the module (psutils) that they mention which shows this. Examples of both Windows and Linux are below.

Taking my laptop as an example (though we have also tested server in the past with the same inaccurate results). Windows performance monitor reports 5% swap/page file usage.

Directly running the python module they use to pull this info

psutil.virtual_memory()

svmem(total=16953987072, available=7974776832, percent=53.0, used=8979210240, free=7974776832)

psutil.swap_memory()

sswap(total=23396438016, used=14038126592, free=9358311424, percent=60.0, sin=0, sout=0)

First command shows total physical memory (RAM). The second is supposed to be showing swap, but actually is calculating total available virtual memory (including swap.) I have a 6 GB swap file, I do not have a 22 GB swap file and swap is not using 14 GB. It is adding both swap and the physical memory together to report the total and I’m not completely sure what it is adding together to get the used value.

@MrPippin66
Copy link

I think is actually a bug in psutil. Not sure which version you downloaded.

giampaolo/psutil#1927

This was put in psutil back in March, so wouldn't have been in the last ncpa client.

Hopefully, will get pulled into the next NCPA build.

@jomann09
Copy link
Contributor

This should be fixed in the next version, 2.4.0 - the new psutil will be bundled in that.

@ccztux
Copy link
Contributor

ccztux commented Jan 4, 2022

As described in #844 i dont think this is fixed with version 2.4.0.

@gittethis
Copy link
Contributor

-i've built (2.4.0) with psutil 5.9.2 (latest(?)) and encountered the "memory/swap" bug.
-pipuninstalled it and downgraded to 5.8.0, built again and the swap bug is gone..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants