nikademus79 / psutil

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

get_memory_info() doesnt exist in mac os x 10.6 #138

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. import psutil
2. psutil.get_memory_info()

What is the expected output? What do you see instead?
memory info
psutil.get_memory_info()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'get_memory_info'

What version of psutil are you using? What Python version?
0.2.0 , python 2.6 and 2.7
On what operating system? Is it 32bit or 64bit version?
32

Original issue reported on code.google.com by ping...@gmail.com on 2 Dec 2010 at 12:19

GoogleCodeExporter commented 8 years ago
get_memory_info() is a per-process function, not a module-wide system function: 

    >>> import psutil, os
    >>> p = psutil.Process(os.getpid())
    >>> p.get_memory_info()
    meminfo(rss=3796992, vms=618160128)

Memory information for the system is retrieved with module functions like 
avail_phymem()/avail_virtmem(), and used_phymem()/used_virtmem()

Original comment by jlo...@gmail.com on 2 Dec 2010 at 12:33