Incorrect memory readings when run inside OpenVZ container

180 views
Skip to first unread message

Prashanth Ellina

unread,
Jan 10, 2012, 1:53:07 AM1/10/12
to psutil
root@server:~# free
total used free shared buffers
cached
Mem: 3145728 625004 2520724 0
0 0
-/+ buffers/cache: 625004 2520724
Swap: 0 0 0


>>> psutil.phymem_usage()
usage(total=8343113728L, used=7989563392L, free=353550336L,
percent=91.1)
>>> psutil.TOTAL_PHYMEM
8343113728L


How can I fix this?

Giampaolo Rodolà

unread,
Jan 10, 2012, 6:11:55 AM1/10/12
to psu...@googlegroups.com
Il 10 gennaio 2012 07:53, Prashanth Ellina <prashan...@gmail.com>
ha scritto:
> --
> You received this message because you are subscribed to the "Python process utilities (psutil)" project group:
> http://code.google.com/p/psutil
> To post to this group, send email to psu...@googlegroups.com
> To unsubscribe from this group, send email to psutil-un...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/psutil

Please try this and paste the output:

import psutil, o/'s
mem = psutil.phymem_usage()
print "psutil: total=%s used=%s free=%s\n" % (mem.total / 1048576,
mem.used / 1048576,
mem.free / 1048576)
os.system('free -m')


We had a similar issue which is supposed to be fixed now (0.4.1 version):
http://code.google.com/p/psutil/issues/detail?id=232

Also, what platform are you using? 32 or 64 bit? What psutil version?


Regards,

G.

Reply all
Reply to author
Forward
0 new messages