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

FreeBSD virtual_memory() some values incorrect #1328

Closed
stratacast opened this issue Aug 17, 2018 · 2 comments
Closed

FreeBSD virtual_memory() some values incorrect #1328

stratacast opened this issue Aug 17, 2018 · 2 comments
Labels

Comments

@stratacast
Copy link

I'm running on FreeBSD 11.2 with Python 2.7.15 and Python 3.6.5 and have psutil version (5, 4, 6). I found that some of the values are incorrect, namely buffers, cache, and available.

Here are the values from psutil.virtual_memory()

svmem(
    total=17143341056, 
    available=622067712, 
    percent=96.4, 
    used=15936098304, 
    free=171257856, 
    active=9863168, 
    inactive=450809856, 
    buffers=0, 
    cached=0, 
    shared=190181376, 
    wired=15926235136
)

As you can see, buffers and caches are 0, but a simple output from htop shows this:

Mem[|||||||||**********************3.15G/16.0G]
Swp[|||||| 552M/4.00G]

The *** are cache. And free shows this:

Mem: 9916K Active, 430M Inact, 99M Laundry, 15G Wired, 189M Free
ARC: 12G Total, 863M MFU, 10G MRU, 24M Anon, 181M Header, 812M Other
10G Compressed, 14G Uncompressed, 1.43:1 Ratio
Swap: 4096M Total, 552M Used, 3544M Free, 13% Inuse

My thought is that available is incorrect because psutil is unable to accurately collect buffers and cache correct? This appears to work on Fedora 28 with psutil version (5, 4, 3):

svmem(
total=8202326016,
available=3804073984,
percent=53.6,
used=3507441664, 
free=2125094912, 
active=4115578880, 
inactive=1464582144, 
buffers=191705088, 
cached=2378084352, 
shared=579563520
)
@giampaolo
Copy link
Owner

What's the output of the following commands?

sysctl vm.stats.vm.v_cache_count
sysctl vfs.bufspace

This is how psutil determines cache and buffer memory (in C).
Available is calculated as inactive + cached + free. Why do you say available mem is incorrect?

@stratacast
Copy link
Author

For both of those outputs I get 0. This tells me there's something that is incorrectly reporting these values in FreeBSD then

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

2 participants