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

Add -u option for one unit size - issue/#39 #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sumomo-99
Copy link

This pull request add a -u option to allow setting one unit size to like df -k.
usage:

$ sudo ./ps_mem.py -u k
Private  +   Shared  =  RAM used       Program
......
22180 KiB +    80 KiB = 22260 KiB       docker-containerd
37748 KiB +   568 KiB = 38316 KiB       netdata
61436 KiB +   265 KiB = 61701 KiB       dockerd
---------------------------------
                        197820 KiB
=================================

option
-u , --unit=U    Unit size. U are b,k,m,g,t (powers of 1024). Default unit is KiB.
b: byte
k: KiB
m: MiB
g: GiB
t: TiB

@pixelb
Copy link
Owner

pixelb commented Apr 17, 2018

Note this will mess up alignment
Also aligment may change over time
Note the --total output is unformatted and so useful for processing/monitoring
Can you describe your use case in detail.

thanks

@sumomo-99
Copy link
Author

One unit size is useful when I want to find out what process is large private or shared memory, in all processes.
If there is a sorting option by private or shared memory, this pull request may not be necessary.

thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants