5 use t::common qw( new_fh );
7 my ($fh, $filename) = new_fh();
8 my $db = DBM::Deep->new( file => $filename, fh => $fh, );
12 $db->{randkey()} = 1 for 1 .. 1000;
14 plan tests => $todo*2;
17 my @mem = (mem(0), mem(1));
18 for my $i (1 .. $todo) {
19 $db->{randkey()} = [@mem];
21 print STDERR " @mem \r";
23 my @tm = (mem(0), mem(1));
25 skip( not($mem[0]), $tm[0] <= $mem[0] );
26 skip( not($mem[1]), $tm[1] <= $mem[1] );
28 $error_count ++ if $tm[0] > $mem[0] or $tm[1] > $mem[1];
29 die " ERROR: that's enough failures to prove the point ... " if $error_count > 20;
36 my @k = map { int rand 100 } 1 .. 10;
43 open my $in, "/proc/$$/statm" or return 0;
44 my $line = [ split m/\s+/, <$in> ];
47 return $line->[shift];
53 Provides information about memory status in pages. The columns are:
55 size total program size
56 resident resident set size
61 dt dirty pages (unused in Linux 2.6)