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

Support for per-process memory bytes/KB utilization #38

Closed
giampaolo opened this issue May 23, 2014 · 8 comments
Closed

Support for per-process memory bytes/KB utilization #38

giampaolo opened this issue May 23, 2014 · 8 comments

Comments

@giampaolo
Copy link
Owner

From jlo...@gmail.com on March 12, 2009 17:37:04

psutil should support per-process memory utilization statistics in both raw
(e.g. bytes) numbers and % utilization.

Original issue: http://code.google.com/p/psutil/issues/detail?id=38

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 17, 2009 09:19:35

Labels: Progress-0in4

@giampaolo
Copy link
Owner Author

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

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 17, 2009 14:52:03

Cc: yanraber

@giampaolo
Copy link
Owner Author

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.

@giampaolo
Copy link
Owner Author

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

@giampaolo
Copy link
Owner Author

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

@giampaolo
Copy link
Owner Author

From billiej...@gmail.com on March 21, 2009 05:39:00

r289 attempts to implement a semi-reliable test case.

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:47:24

Updated csets after the SVN -> Mercurial migration: r277 == revision 4ff2f6621026 r289 == revision decb1e50ad3f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant