summaryrefslogtreecommitdiffstats
path: root/lib/ASM/Commander.pm
diff options
context:
space:
mode:
authorLibravatarDoug Freed <dwfreed@mtu.edu>2016-01-14 21:52:42 -0700
committerLibravatarDoug Freed <dwfreed@mtu.edu>2016-01-14 21:52:42 -0700
commit2aa15f5a89ffeee2a1ee6d443afb8129ba644255 (patch)
treeb75b3e0e1581e5b6649cb9300940179f306eac78 /lib/ASM/Commander.pm
parentd8bccaa91a019b05309ef7de70796fa2337d395d (diff)
Fix ASM's memory usage display to be more accurate
Diffstat (limited to 'lib/ASM/Commander.pm')
-rw-r--r--lib/ASM/Commander.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ASM/Commander.pm b/lib/ASM/Commander.pm
index f53781f..9a28e3b 100644
--- a/lib/ASM/Commander.pm
+++ b/lib/ASM/Commander.pm
@@ -270,9 +270,12 @@ sub cmd_teredo {
sub cmd_status {
my ($conn, $event) = @_;
- my $size = `ps -p $$ h -o size`;
+ my $size = `pmap -X $$ | tail -n 1`;
+ $size =~ s/^\s+|\s+$//g;
+ my @temp = split(/ +/, $size);
+ $size = $temp[1] + $temp[5];
my $cputime = `ps -p $$ h -o time`;
- chomp $size; chomp $cputime;
+ chomp $cputime;
my $upstr = '';
my $up = (time - $::starttime);
if (int($up/86400) != 0) { #days