Closed giampaolo closed 10 years ago
From billiej...@gmail.com on March 17, 2009 09:19:35
Labels: Progress-0in4
From billiej...@gmail.com on March 17, 2009 14:50:01
As for raw bytes information we need to decide what values we want to return.
Since figuring out how memory works on all different platforms is very complex as for
now I think we better return the minimal information possible for simplicity and add
more detailed information in future releases.
Figuring out which information are portable between different platforms is also of
primary importance.
On Linux we can easily retrieve virtual and resident memory, known under ps by the
name of VMS and RSS respectively, but I'm not sure that summing them will give us the
total memory used by the process (for example, this article makes me raise more than
one doubt:
http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html ).
As for the data type we want our get_memory_info() function to return I think we have
two options:
- returning a tuple, like we did for get_cpu_usage() function
- returning a MemoryInfo class instance similar to ProcessInfo containing memory
values accessible as class attributes
Considering that in future release we might add new memory information, using a
MemoryInfo class would make more sense to avoid breaking backward compatibility.
My2cents
Labels: -OpSys-All
From billiej...@gmail.com on March 17, 2009 14:52:03
Cc: yanraber
From jlo...@gmail.com on March 20, 2009 11:40:22
We should provide properties for RSS and VMS just like top/ps/taskmgr all do. The
numbers should not be added since in most cases it is desirable to differentiate
between virtual memory size and resident memory size. From what I've seen all
platforms differentiate between the two and it's reasonably straightforward to
retrieve RSS/VMS per-process.
I'm not decided on what the implementation should be but I think it makes sense to
have the interface be simple properties for rss/vms and perhaps mem_util or something
like that for % utilization.
From billiej...@gmail.com on March 20, 2009 14:48:35
Percent utilization has been moved into issue 41 .
Summary: Support for per-process memory bytes/KB utilization
From billiej...@gmail.com on March 20, 2009 19:04:12
Implemented on OS X, FreeBSD, Windows and Linux as r277 , r278 , r279 and r280 .
Leaving this open as long as test cases are available and working.
Labels: -Progress-0in4 Progress-4in4
From billiej...@gmail.com on March 21, 2009 05:39:00
r289 attempts to implement a semi-reliable test case.
From jlo...@gmail.com on March 12, 2009 17:37:04
Original issue: http://code.google.com/p/psutil/issues/detail?id=38