anfedorov / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Memory usage incorrectly reported in Ubuntu 11.04/Python 2.7.1 #393

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
import psutil as psutil
print psutil.phymem_usage()

What is the expected output?/What do you see instead?
Memory usage is reported as being around 90-100% when reports by htop, top and 
free all report memory usage as being around the 5% mark.

psutil output:
usage(total=33671311360L, used=33228730368L, free=442580992L, percent=97.6)

free -m output:
             total       used       free     shared    buffers     cached
Mem:          1596        688        907          0          0          0
-/+ buffers/cache:        688        907
Swap:            0          0          0

What version of psutil are you using? What Python version?
Latest psutil downloaded from easy_install (0.7.1), Python 2.7.1

On what operating system? Is it 32bit or 64bit version?
Ubuntu Server 11.04 64bit

Please provide any additional information below.
The same script runs fine on CentOS 6.4 and returns correct values. Running as 
root/my own user bares no difference.

Original issue reported on code.google.com by frank.pl...@gmail.com on 17 Jun 2013 at 4:55

GoogleCodeExporter commented 8 years ago
psutil.phymem_usage() is deprecated. You should use psutil.virtual_memory() 
instead.
After you did that try this script:
https://code.google.com/p/psutil/source/browse/examples/free.py
It will provide the same results as free cli utility.
Closing this out as invalid.

Side note: next time please use the mailing list.

Original comment by g.rodola on 17 Jun 2013 at 5:00

GoogleCodeExporter commented 8 years ago
My apologies - I did read that phymem_usage() was deprecated. Using 
psutil.virtual_memory() works fine and reports the same on both Ubuntu 11.04 
and CentOS 6.4.

Thanks,
-Frank

Original comment by frank.pl...@gmail.com on 17 Jun 2013 at 6:10

GoogleCodeExporter commented 8 years ago
No worries. ;)

Original comment by g.rodola on 17 Jun 2013 at 6:11