diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-23 12:50:54 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-23 12:50:54 +0000 |
commit | f962a0354e2426ef9781df97e4b02b32e438783c (patch) | |
tree | 4e0b3363932fbc0a30d5242b58ca5a0fea48d2a8 /shell/hush_test/hush-z_slow/leak_var.tests | |
parent | f23c3f95e88302923147f159115180da7cf0344e (diff) | |
download | busybox-w32-f962a0354e2426ef9781df97e4b02b32e438783c.tar.gz busybox-w32-f962a0354e2426ef9781df97e4b02b32e438783c.tar.bz2 busybox-w32-f962a0354e2426ef9781df97e4b02b32e438783c.zip |
hush: plug memory leak
Diffstat (limited to 'shell/hush_test/hush-z_slow/leak_var.tests')
-rwxr-xr-x | shell/hush_test/hush-z_slow/leak_var.tests | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/shell/hush_test/hush-z_slow/leak_var.tests b/shell/hush_test/hush-z_slow/leak_var.tests index d3ca25908..388d6a734 100755 --- a/shell/hush_test/hush-z_slow/leak_var.tests +++ b/shell/hush_test/hush-z_slow/leak_var.tests | |||
@@ -1,24 +1,46 @@ | |||
1 | pid=$$ | 1 | pid=$$ |
2 | 2 | ||
3 | # Warm up | 3 | # Warm up |
4 | unset t | ||
5 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
6 | export t | ||
7 | unset t | ||
8 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
9 | export t | ||
10 | unset t | ||
11 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
12 | export t | ||
13 | unset t | ||
14 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
15 | export t | ||
16 | unset t | ||
17 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
18 | export t | ||
19 | i=1 | ||
20 | if test $i = 1111111111111111111111111111111111111111111111; then i=2; fi | ||
21 | beg=`ps -o pid,vsz | grep "^ *$pid "` | 4 | beg=`ps -o pid,vsz | grep "^ *$pid "` |
5 | i=1 | ||
6 | while test $i != X; do | ||
7 | unset t | ||
8 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
9 | export t | ||
10 | unset t | ||
11 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
12 | export t | ||
13 | unset t | ||
14 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
15 | export t | ||
16 | unset t | ||
17 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
18 | export t | ||
19 | unset t | ||
20 | t=111111111111111111111111111111111111111111111111111111111111111111111111 | ||
21 | export t | ||
22 | i=1$i | ||
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 | ||
42 | done | ||
43 | end=`ps -o pid,vsz | grep "^ *$pid "` | ||
22 | 44 | ||
23 | echo "Measuring memory leak..." | 45 | echo "Measuring memory leak..." |
24 | beg=`ps -o pid,vsz | grep "^ *$pid "` | 46 | beg=`ps -o pid,vsz | grep "^ *$pid "` |