ps_mem icon indicating copy to clipboard operation
ps_mem copied to clipboard

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

Open sumomo-99 opened this issue 6 years ago • 2 comments

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

sumomo-99 avatar Apr 17 '18 02:04 sumomo-99

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

pixelb avatar Apr 17 '18 08:04 pixelb

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

sumomo-99 avatar Apr 17 '18 10:04 sumomo-99