I've used this:
sub my_mem { my @pslines = grep( m{ \A \s* (?: \d+ \s+ ){2} $$ \b }xms, `ps axl` ); die if ( scalar @pslines != 1 ); my $line = $pslines[0]; chomp $line; my @words = split /\s+/, $line; return $words[6]; }
It relies on the system's ps axl, not procfs. You can also use Devel::Size to size up individual data structures at run time.
In reply to Re^2: How to tell if script sucks...memory
by kyle
in thread How to tell if script sucks...memory
by jriggs420
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |