4 beg=`ps -o pid,vsz | grep "^ *$pid "`
7 set -- a b c d e f g h i j k l m n o p q r s t u v w x y z
12 set -- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
16 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
17 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
18 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
19 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
20 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
21 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
22 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
23 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
24 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
25 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
26 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
27 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
28 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
29 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
30 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
31 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
32 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
33 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
34 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
36 end=`ps -o pid,vsz | grep "^ *$pid "`
38 # Warm up again (I do need it on my machine)
39 beg=`ps -o pid,vsz | grep "^ *$pid "`
41 while test $i != X; do
42 set -- a b c d e f g h i j k l m n o p q r s t u v w x y z
47 set -- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
51 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
52 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
53 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
54 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
55 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
56 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
57 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
58 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
59 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
60 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
61 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
62 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
63 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
64 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
65 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
66 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
67 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
68 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
69 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
71 end=`ps -o pid,vsz | grep "^ *$pid "`
72 if test "$beg" != "$end"; then
73 true echo "vsz grows: $beg -> $end"
75 true echo "vsz does not grow"
78 echo "Measuring memory leak..."
79 beg=`ps -o pid,vsz | grep "^ *$pid "`
81 while test $i != X; do
82 set -- a b c d e f g h i j k l m n o p q r s t u v w x y z
87 set -- A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
91 if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi
92 if test $i = 1111111111111111111111111111111111111111111112; then i=3; fi
93 if test $i = 1111111111111111111111111111111111111111111113; then i=4; fi
94 if test $i = 1111111111111111111111111111111111111111111114; then i=5; fi
95 if test $i = 1111111111111111111111111111111111111111111115; then i=6; fi
96 if test $i = 1111111111111111111111111111111111111111111116; then i=7; fi
97 if test $i = 1111111111111111111111111111111111111111111117; then i=8; fi
98 if test $i = 1111111111111111111111111111111111111111111118; then i=9; fi
99 if test $i = 1111111111111111111111111111111111111111111119; then i=a; fi
100 if test $i = 111111111111111111111111111111111111111111111a; then i=b; fi
101 if test $i = 111111111111111111111111111111111111111111111b; then i=c; fi
102 if test $i = 111111111111111111111111111111111111111111111c; then i=d; fi
103 if test $i = 111111111111111111111111111111111111111111111d; then i=e; fi
104 if test $i = 111111111111111111111111111111111111111111111e; then i=f; fi
105 if test $i = 111111111111111111111111111111111111111111111f; then i=g; fi
106 if test $i = 111111111111111111111111111111111111111111111g; then i=h; fi
107 if test $i = 111111111111111111111111111111111111111111111h; then i=i; fi
108 if test $i = 111111111111111111111111111111111111111111111i; then i=j; fi
109 if test $i = 111111111111111111111111111111111111111111111j; then i=X; fi
111 end=`ps -o pid,vsz | grep "^ *$pid "`
113 if test "$beg" != "$end"; then
114 echo "vsz grows: $beg -> $end"
116 echo "vsz does not grow"