dpuu has asked for the wisdom of the Perl Monks concerning the following question:
but this doesn't feel very portable. --Davesub get_memory_used { my $result; open STAT, "</proc/$$/status" or die "can't open ...: $!"; while (<STAT>) { /^VmSize.*?(\d+) kB/ or next; $result = $1; last; } close STAT; defined($result) or die "can't find memory used"; return $result * 1024; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get memory usage
by Zaxo (Archbishop) on Aug 24, 2002 at 00:33 UTC | |
|
Re: get memory usage
by RMGir (Prior) on Aug 24, 2002 at 00:30 UTC | |
by sauoq (Abbot) on Aug 24, 2002 at 01:03 UTC | |
|
Re: get memory usage
by perrin (Chancellor) on Aug 24, 2002 at 06:08 UTC | |
by waswas-fng (Curate) on Aug 24, 2002 at 16:04 UTC | |
by perrin (Chancellor) on Aug 24, 2002 at 17:33 UTC | |
|
Re: get memory usage
by zentara (Cardinal) on Aug 25, 2002 at 17:45 UTC |