| Re: Oracle Application Server running out of memory Thanks Chris.
Here is some information I got. Also I am giving here the contents of the oc4j.sh. I am not an Admin guy, so I may not be able to put the pieces together.
1) The Oracle App server and Apache Web Server runs on the same box.
2) The OS is Linux 32bit
3) The System is 64bit.
**************************************
oc4j.sh contents
**************************************
#!/bin/sh
#
# oc4j - shell for invoking OC4J basic operations.
#
# Usage: oc4j [Options]
#
# Options:
# -start : start OC4J
# -shutdown -port <ORMI port> -password <password>
# : stop OC4J
# -version : display the version
# -help : display this message
#
# Copyright (c) 2004, 2005, Oracle. All rights reserved.
#
################################################## #######
########## START CONFIGURATION SECTION ##################
################################################## #######
GLOG_HOME=/u02/otmPROD
JAVA_HOME=/u02/otmPROD/jdk
ORACLE_HOME=$GLOG_HOME/oas
J2EE_HOME=$ORACLE_HOME/j2ee/home
VERBOSE=on MEM_ARGS="-XX:PermSize=256m -XX:MaxPermSize=256m -Xms2048m -Xmx2048m -XX:NewSize=256m -XX:MaxNewSize=256m -verbose:gc"
GC3_OPTIONS="-Duser.home=/u02/otmPROD/glog/config -Dglog.properties=glog.properties"
OC4J_JVM_ARGS="$MEM_ARGS $GC3_OPTIONS"
echo $JVMARGS
# Set DASH variables
DASH_HOME=$GLOG_HOME/dash; export DASH_HOME
XPRESS=$DASH_HOME/bin; export XPRESS
LD_LIBRARY_PATH=$DASH_HOME/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PATH=$DASH_HOME/lib:$PATH; export PATH
#Any persistent arguments to specify at the JVM level can be set here
#By default this will be read from the operating system environment
if [ "$OC4J_JVM_ARGS" ]
then
JVMARGS=$OC4J_JVM_ARGS
else
JVMARGS=
fi
CMDARGS=-userThreads
if [ "$VERBOSE" ]
then
VERBOSE=$VERBOSE
else
VERBOSE=off
fi
ORMI_URL=ormi://localhost
ORMI_USER=oc4jadmin
OC4J_JAR=$J2EE_HOME/oc4j.jar
ADMIN_JAR=$J2EE_HOME/admin.jar
SERVER_XML=$J2EE_HOME/config/server.xml
################################################## #######
########## END CONFIGURATION SECTION ##################
################################################## #######
check_oc4j()
{
EXIT=0
if [ "$JAVA_HOME" = "" ]
then
echo "Error: JAVA_HOME environment variable is not defined."
check_msg="correct JAVA_HOME environment variable."
EXIT=2
elif [ ! -x $JAVA_HOME/bin/java ]
then
echo "Error: Can not find java executable in $JAVA_HOME/bin."
check_msg="correct java executable."
EXIT=2
elif [ "$ORACLE_HOME" = "" ]
then
echo "Error: The ORACLE_HOME environment variable must be set before executing this script. Set this to the directory into which you unzipped oc4j_extended.zip."
check_msg="correct ORACLE_HOME environment variable."
EXIT=2
elif [ ! -r "$OC4J_JAR" ]
then
check_msg="readable $OC4J_JAR."
EXIT=2
elif [ ! -w "$SERVER_XML" ]
then
check_msg="writable $SERVER_XML."
EXIT=2
elif [ ! -r "$ADMIN_JAR" ]
then
check_msg="readable $ADMIN_JAR."
EXIT=2
fi
}
echo_check_msg()
{
echo "Error: The command can not be run without $1"
}
start_oc4j()
{
echo "Starting OC4J from $J2EE_HOME ..."
CMDARGS="-userThreads -config $SERVER_XML"
while [ $# -ge 1 ]
do
case $1 in
*)
echo ""
echo "Error: The optoin \"$1\" was not recognized."
EXIT=1
return
;;
esac
done
if [ "$VERBOSE" = "on" ]
then
echo "Executing: $JAVA_HOME/bin/java $JVMARGS -jar $OC4J_JAR $CMDARGS"
fi
$JAVA_HOME/bin/java $JVMARGS -jar $OC4J_JAR $CMDARGS
}
shutdown_oc4j()
{
while [ $# -ge 1 ]
do
case $1 in
-port)
shift
if [ "$1" = "" ]
then
echo ""
echo "Error: You must specify the ORMI port value."
EXIT=1
return
else
ORMI_PORT=$1
shift
fi
;;
-password)
shift
if [ "$1" = "" ]
then
echo ""
echo "Error: You must specify the password value."
EXIT=1
return
else
ORMI_PASSWORD=$1
shift
fi
;;
*)
echo ""
echo "Error: The option \"$1\" was not recognized."
EXIT=1
return
;;
esac
done
if [ "$ORMI_PORT" = "" ]
then
echo ""
echo "Error: You must specify the ORMI port using the -port switch."
echo " The port value can be found in $J2EE_HOME/config/rmi.xml."
EXIT=1
return
fi
if [ "$ORMI_PASSWORD" = "" ]
then
echo ""
echo "Error: You must specify the ORMI password using the -password switch."
EXIT=1
return
fi
echo "Shutdown OC4J instance..."
CMDARGS="$ORMI_URL:$ORMI_PORT $ORMI_USER $ORMI_PASSWORD -shutdown"
if [ "$VERBOSE" = "on" ]
then
echo "Executing: $JAVA_HOME/bin/java $JVMARGS -jar $ADMIN_JAR $CMDARGS"
fi
$JAVA_HOME/bin/java $JVMARGS -jar $ADMIN_JAR $CMDARGS
}
version()
{
echo "Getting the version of OC4J instance..."
CMDARGS="-version"
if [ "$VERBOSE" = "on" ]
then
echo "Executing: $JAVA_HOME/bin/java $JVMARGS -jar $OC4J_JAR $CMDARGS"
fi
$JAVA_HOME/bin/java $JVMARGS -jar $OC4J_JAR $CMDARGS
}
help()
{
cat <<EOF
Usage: oc4j [Options]
Options:
-start : start OC4J
-shutdown -port <ORMI port> -password <password>
: stop OC4J
-version : display the version
-help : display this message
EOF
}
########################################
### Start main function section ###
########################################
check_oc4j
if [ ! "$EXIT" -eq 0 ]
then
echo_check_msg "$check_msg"
else
if [ $# -eq 0 ]
then
help
else
# the first argument
CMDARG="$1"
# decrement number of arguments
shift
# get the rest of the command line
case $CMDARG in
-start)
start_oc4j "$@"
;;
-shutdown)
shutdown_oc4j "$@"
;;
-version)
if [ $# -gt 0 ] ; then
echo ""
echo "Error: The option \"$CMDARG\" does not take any argument."
EXIT=1
else
version
fi
;;
-help)
help
EXIT=0
;;
*)
echo ""
echo "Error: The option \"$CMDARG\" was not recognized."
EXIT=1
;;
esac
if [ $EXIT -eq 1 ]
then
help
fi
fi
fi |