[Israel.pm] memory usage

Oron Peled oron at actcom.co.il
Tue Sep 5 11:35:50 PDT 2006

On Tuesday, 5 בSeptember 2006 16:33, Eitan Schuler wrote:
> correct. this is for linux - for Solaris check out the ps synax.

1. Modern versions of Linux ps support both the BSD flags (e.g: aux)
   and the SysV flags (e.g: -ef) that are used in Solaris,
   HP-UX, Irix,... and all other "Posix.1" Unices.
2. Since some flags letters overlap with different meaning
   (e.g: '-f' vs. 'f') Linux ps differentiate through the following
   syntactic trick:

   In the original BSD ps the '-' character before the flag letters
   was optional (just like in tar). Therefore, if the ps get flags
   without a leading '-' it interpret them according to BSD semantics.
   Otherwise, it parse them as SysV flags.
   [in Linux ps man page, you'll see there is another way to dictate this
    separation through the environment...]

Remark: some people still use 'ps -aux' (note the '-') which is
        deprecated. Instead use either 'ps aux' or 'ps -ef'

3. As Guy indicated you want the VSZ field, but I'm not sure
   which SysV *standard* flag give this field [of course the
   Linux version have a nice '-o pid,vsz,cmd' which makes this
   easy, but we are looking for a standard way...] You'll
   have to browse through Solaris man page for that.

> On 9/5/06, Gabor Szabo <szabgab at gmail.com> wrote:
> > On 9/5/06, Eitan Schuler <eitan.schuler at gmail.com> wrote:
> > > quick and dirty:
> > > print STDERR `ps -auxw | fgrep <your program name> | fgrep -v fgrep `;
> > > you can add an awk to this. look at the RSS column if increases.

4. It's a bit funny to see on a perl mailing list people using
   external tools that are equivalent to perl built-ins.
   Let's make it quicker and dirtier.

   perl -e 'print STDERR grep($_ =~ "konsole" && $_ !~ "grep", qx|ps aux|)'

Oron Peled                             Voice/Fax: +972-4-8228492
oron at actcom.co.il                  http://www.actcom.co.il/~oron
ICQ UIN: 16527398

"Emacs is a fine OS, but it lacks a good text editor"

More information about the Perl mailing list