# The standard describes the "vsz" format as:
#        The size of the process in (virtual) memory
#        in 1024 byte units as a decimal integer.
#
# It's hard to tell 1000-byte from 1024-byte units,
# but easy to tell 1024-byte from 512-byte or 2 kB.
# On a 64-bit system, watch for 4 GB troubles as well.

# throw in the PID to ensure whitespace on the left
ARGS="-C gigabyte -o pid= -o vsz="
GOOD=0
EVALFN=1
KILLFN=1

BITSIZE=`./gigabyte`

evalfn () {
  if [ $BITSIZE == 32bit ] ; then
    egrep ' 1......$' stdout >> /dev/null
  else
    egrep ' 1.......$' stdout >> /dev/null
  fi
}

killfn () {
  killall -9 gigabyte
}
