4 beg=`ps -o pid,vsz | grep "^ *$pid "`
8 t=111111111111111111111111111111111111111111111111111111111111111111111111
11 t=111111111111111111111111111111111111111111111111111111111111111111111111
14 t=111111111111111111111111111111111111111111111111111111111111111111111111
17 t=111111111111111111111111111111111111111111111111111111111111111111111111
20 t=111111111111111111111111111111111111111111111111111111111111111111111111
23 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
24 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
25 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
26 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
27 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
28 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
29 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
30 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
31 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
32 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
33 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
34 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
35 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
36 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
37 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
38 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
39 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
40 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
41 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
43 end=`ps -o pid,vsz | grep "^ *$pid "`
45 echo "Measuring memory leak..."
46 beg=`ps -o pid,vsz | grep "^ *$pid "`
48 while test $i != X; do
50 t=111111111111111111111111111111111111111111111111111111111111111111111111
53 t=111111111111111111111111111111111111111111111111111111111111111111111111
56 t=111111111111111111111111111111111111111111111111111111111111111111111111
59 t=111111111111111111111111111111111111111111111111111111111111111111111111
62 t=111111111111111111111111111111111111111111111111111111111111111111111111
65 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
66 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
67 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
68 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
69 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
70 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
71 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
72 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
73 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
74 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
75 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
76 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
77 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
78 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
79 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
80 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
81 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
82 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
83 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
85 end=`ps -o pid,vsz | grep "^ *$pid "`
87 if test "$beg" != "$end"; then
88 echo "vsz grows: $beg -> $end"
90 echo "vsz does not grow"