#!/bin/sh
# -----------------------------------------------------------------------------
# Script to set enviroment
#
# $Id: setenv.sh,v 1.1 2002/08/04 18:19:43 patrickl Exp $
# -----------------------------------------------------------------------------

# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" ]; then
  echo "The JAVA_HOME environment variable is not defined"
  echo "This environment variable is needed to run this program"
  exit 1
fi

oldCP=$CLASSPATH
 
DBMT_HOME=..

unset LOCALCLASSPATH
for i in $DBMT_HOME/lib/*.jar ; do
  if [ "$LOCALCLASSPATH" != "" ]; then
       LOCALCLASSPATH=${LOCALCLASSPATH}:$i
  else
    LOCALCLASSPATH=$i
  fi
done

# This is the base heap size -- you may increase or decrease it to fit your
# system's memory availablity:
HEAP="-Xms512m -Xmx512m"

# There's an awful lot of per-sample objects allocated during test run, so we
# need a large eden to avoid too frequent scavenges -- you'll need to tune this
# down proportionally if you reduce the HEAP values above:
###############NEW="-XX:NewSize=128m -XX:MaxNewSize=128m"

# This ratio and target have been proven OK in tests with a specially high
# amount of per-sample objects (the HtmlParserHTMLParser tests):
SURVIVOR="-XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=50%"

# PermSize is a scam. Leave it like this:
PERM="-XX:PermSize=64m -XX:MaxPermSize=64m"
########ARGS="-DcataliNA.home=$DBMT_HOME $HEAP $NEW $SURVIVOR $PERM -cp $DBMT_HOME:$LOCALCLASSPATH"

ARGS="-Dcatalina.home=$DBMT_HOME -cp $DBMT_HOME:$LOCALCLASSPATH" 

$JAVA_HOME/bin/java $ARGS com.hintsoft.dbmt.MigrationRunner ../conf/migration.xml
