#! /bin/ksh

#
# Name        : ${HOME}/bin/TestMemLeak.ksh
#
# Version     : 1.0
#
# Author      : Gerard van Wageningen
#
# Description : Check on a memory leak in the Kornshell version M-11/16/88f. 
#
# 1.0   First Version
#

\whence set_debug 1>/dev/null 2>&1 && eval $( set_debug ${0##*/} )

function EatMemory
{
  typeset AAA; typeset BBB; typeset CCC; typeset DDD; typeset EEE
  typeset FFF; typeset GGG; typeset HHH; typeset III; typeset JJJ
  typeset KKK; typeset LLL; typeset MMM; typeset NNN; typeset OOO
  typeset PPP; typeset QQQ; typeset RRR; typeset SSS; typeset TTT
  typeset UUU; typeset VVV; typeset WWW; typeset XXX; typeset YYY
  typeset ZZZ

  return 0
} # function EatMemory

while true
do
  EatMemory
done &

sleep 1 
while ps auxw | grep $! | grep -v grep
do
  sleep 1
done 

exit 0 

################# EOF #################
