Re: [PATCH] per-program memory usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luke Macken wrote:
I find myself using the ps_mem.py[0] script on almost every machine I have
access to, so I hacked 'mem' support into the process module.  This is a proof
of concept, as I'm not entirely sure that is the optimal place for it, nor do I
think the code couldn't use a little polish.  I literally copied and pasted
into a mem() method.  If we want to rely on an external code such as ps_mem.py,
we could even think about pulling it in from the Makefile, and calling it from
a module using sub_process.

Attached is a patch that adds ProcessModule.mem(), which lets you do the
do the following to your minions:

    [lmacken@crow ~]$ sudo func tomservo process mem
    on https://tomservo:51234 running process mem ()
    [' Private  +   Shared  =  RAM used       Program',
     '  4.0 MiB +   3.1 MiB =   7.1 MiB       openbox',
     '  2.2 MiB +   5.2 MiB =   7.4 MiB       clock-applet',
     '  2.8 MiB +   8.6 MiB =  11.4 MiB       wnck-applet',
     '  1.7 MiB +   9.8 MiB =  11.5 MiB       nm-applet',
     '  2.6 MiB +   9.4 MiB =  11.9 MiB       spamd (3)',
     '  3.7 MiB +   9.5 MiB =  13.2 MiB       gnome-panel',
     ' 14.8 MiB +   4.3 MiB =  19.2 MiB       Xorg',
     ' 11.0 MiB +   9.6 MiB =  20.6 MiB       nautilus',
     ' 10.5 MiB +  10.3 MiB =  20.8 MiB       gnome-terminal',
     '128.3 MiB +  11.3 MiB = 139.5 MiB       firefox-bin',
     ' Private  +   Shared  =  RAM used       Program']

Comments/suggestions?

luke

[0]: http://www.pixelbeat.org/scripts/ps_mem.py
------------------------------------------------------------------------

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

Awesome. I'd potentially parse things to make it nicer for computers to script, maybe. NxN array?

However I'm on vacation and am not doing any work so I'll be quiet :)

--Michael




[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux