TT#22005 add tracemem script for memory profiling

Change-Id: I50d4f1abe1d1c5f3471c81a928944625a3bedaa3
changes/81/16181/1
Gerhard Jungwirth 8 years ago
parent 9a85c9a2f9
commit 41372cf8f6

@ -0,0 +1,14 @@
our $old = 0;
BEGIN {
unshift @INC, sub {
my ($self, $file) = @_;
use GTop qw();
my $current=GTop->new->proc_mem($$)->size;
my $delta=$current-$old;
printf "pid %d proc_mem %d delta %-10d file %s\n", $$, $current, $delta, $file;
$old=$current;
}
}
1;
# run with: perl -Isandbox -mtracemem ...
Loading…
Cancel
Save