This repo is obsolete, please see git://git.code.sf.net/p/dummynet/code@master
[ipfw.git] / test / memory_leak.sh
1 #!/bin/sh
2 # this script execute N times the command CMD
3 # collecting the memory usage on a file.
4 # The value of the Dirty memory should not increase
5 # between tests.
6
7 BASE_NAME=ipfw_r5808_
8 N=10000
9 CMD1="/sbin/insmod ../dummynet2/ipfw_mod.ko"
10 CMD2="/sbin/rmmod ipfw_mod"
11
12 # main
13 # remove any previous loaded module
14 /sbin/rmmod ipfw_mod 
15
16 # pre
17
18 for n in `seq $N`; do
19         $CMD1
20         $CMD2
21         [ $n = 10 ] && cat /proc/meminfo > /tmp/${BASE_NAME}_${n}
22         [ $n = 100 ] && cat /proc/meminfo > /tmp/${BASE_NAME}_${n}
23         [ $n = 1000 ] && cat /proc/meminfo > /tmp/${BASE_NAME}_${n}
24 done;
25
26 # post