我发现在启动我的一个JAVA应用中,尽管我在Linux环境给webgic的startWebLogic.sh设置了一 MEM_ARGS="-Xms1024m -Xmx1024m  -XX:PermSize=128m -XX:MaxPermSize=512m"参数但是不起作用,附件是配置文件startWebLogic.sh,经过好长时间的检查终于找出问题所在。
          附件中黑体字所在参数的设置在“ . ${WL_HOME}/common/bin/commEnv.sh”条语句之前,从这条语句的注释看大致意思是:“如果 java_vendor 设置的话,系统会执行该语句,使用cat 命令看了 commEnv.sh文件后才知道系统默认的参数是MEM_ARGS=="-Xms32m -Xmx200m  --XX:MaxPermSize=128m",所以我想把设置参数这条语句MEM_ARGS="-Xms1024m -Xmx1024m  -XX:PermSize=128m -XX:MaxPermSize=512m"放到“ . ${WL_HOME}/common/bin/commEnv.sh之后应该就起作用了吧。经过测试确实如此
   
附件:
#!/bin/sh
# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions
to this configuration.
# *************************************************************************
# This script is used to start WebLogic Server for the domain in the
# current working directory.  This script simply sets the SERVER_NAME
# variable and starts server.
#
# To create your own start script for your domain, all you need to set is
# SERVER_NAME, then starts the server.
#
# Other variables that startWLS takes are:
#
# WLS_USER     - cleartext user for server startup
# WLS_PW       - cleartext password for server startup
# PRODUCTION_MODE    - true for production mode servers, false for
#                development mode
# JAVA_OPTIONS - Java command-line options for running the server. (These
#                will be tagged on to the end of the JAVA_VM and MEM_ARGS)
# JAVA_VM      - The java arg specifying the VM to run.  (i.e. -server,
#                -hotspot, etc.)
# MEM_ARGS     - The variable to override the standard memory arguments
#                passed to java
#
# For additional information, refer to the WebLogic Server Administration# Console Online Help( http://e-
docs.bea.com/wls/docs81/ConsoleHelp/startstop.html)
# *************************************************************************
# Initialize the common environment.

WL_HOME="/weblogic/bea/weblogic81"

PRODUCTION_MODE="true"

JAVA_VENDOR="Sun"

JAVA_HOME="/weblogic/bea/jdk142_11"
 
MEM_ARGS="-Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m"
 

# Call commEnv here AFTER setting the java_vendor to get common environmental settings.

. ${WL_HOME}/common/bin/commEnv.sh

# Set SERVER_NAME to the name of the server you wish to start up.

SERVER_NAME="myserver"

CLASSPATH="${WEBLOGIC_CLASSPATH}:${POINTBASE_CLASSPATH}:${JAVA_HOME}/jre/lib/rt.jar:${WL_HOME}/server/lib/webservices.jar:${C
LASSPATH}"
export CLASSPATH
 
# Call WebLogic Server

echo "."
echo "CLASSPATH=${CLASSPATH}"
echo "."
echo "PATH=${PATH}"
echo "."
echo "MEM_ARGS=${MEM_ARGS}"   #MODI BY LV
echo "***************************************************"
echo "*  To startWebLogic Server, use a username and   *"
echo "*  password assigned to an admin-level user.  For *"
echo "*  server administration, use the WebLogic Server *"
echo "*  console at http://[hostname]:[port]/console    *"
echo "***************************************************"

${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -
Dweblogic.ProductionModeEnabled=${PRODUCTION_MODE} -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy"
weblogic.Server