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; }
In reply to get memory usage by dpuu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |