Index: conf/hive-env.sh.template =================================================================== --- conf/hive-env.sh.template (revision 1183405) +++ conf/hive-env.sh.template (working copy) @@ -12,7 +12,11 @@ # reducing memory usage: # # if [ "$SERVICE" = "cli" ]; then -# export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=12 -Xms10m -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:+UseParNewGC -XX:-UseGCOverheadLimit" +# if [ "$DEBUG" != "true" ]; then +# export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=12 -Xms10m -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:+UseParNewGC -XX:-UseGCOverheadLimit" +# else +# export HADOOP_OPTS="$HADOOP_OPTS -XX:NewRatio=12 -Xms10m -XX:MaxHeapFreeRatio=40 -XX:MinHeapFreeRatio=15 -XX:-UseGCOverheadLimit"; +# fi # fi # The heap size of the jvm stared by hive shell script can be controlled via: @@ -30,5 +34,5 @@ # Hive Configuration Directory can be controlled by: # export HIVE_CONF_DIR= -# Folder containing extra ibraries required for hive compilation/execution can be controlled by: +# Folder containing extra libraries required for hive compilation/execution can be controlled by: # export HIVE_AUX_JARS_PATH= Index: bin/ext/help.sh =================================================================== --- bin/ext/help.sh (revision 1183405) +++ bin/ext/help.sh (working copy) @@ -20,8 +20,9 @@ echo "Usage ./hive --service serviceName " echo "Service List: $SERVICE_LIST" echo "Parameters parsed:" - echo " --auxpath : Auxillary jars " + echo " --auxpath : Auxillary jars" echo " --config : Hive configuration directory" + echo " --debug : Starts in debug mode" echo " --service : Starts specific service/component. cli is default" echo "Parameters used:" echo " HADOOP_HOME : Hadoop install directory" Index: bin/hive =================================================================== --- bin/hive (revision 1183405) +++ bin/hive (working copy) @@ -42,6 +42,10 @@ HELP=_help shift ;; + --debug) + export DEBUG="true" + shift + ;; *) break ;; @@ -60,6 +64,11 @@ . "${HIVE_CONF_DIR}/hive-env.sh" fi +#For Debug -XX:+UseParallelGC is needed, as it is a (unfortunately not perfect) workaround for JVM 6862295 bug, that affects some JVMs still in use +if [ "$DEBUG" = "true" ]; then + export HADOOP_CLIENT_OPTS=" -XX:+UseParallelGC -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000" +fi + CLASSPATH="${HIVE_CONF_DIR}" HIVE_LIB=${HIVE_HOME}/lib