如何更改Tomcat6(MacPorts安装)的内存限制? (-Xmx忽略了???)

时间:2012-05-14 02:42:24

标签: memory-management tomcat6 macports probe

我已经尝试使用catalina.sh中的-Xmx标志更改内存限制,正如我过去用于Linux安装,但是当我访问psi-probe(以前的lambda探测器)它声称我有限制为1.78Gb。我已经尝试将最大限制设置为4096m和6144m并且没有效果。我运行它的机器有足够的内存来支持这些配置,但仍然报告限制为1.78Gb。

我有一个特别繁重的应用程序,在大约1.6Gb时堆积空间错误。

有关为什么忽略此配置或可能会覆盖此配置的任何建议?

修改

setenv.sh的内容是:

#!/bin/sh
# 
# setenv.sh
#
# You may edit this script to set defaults for such variables as JAVA_HOME.
#
# For Apple Java, the $JAVA_HOME is not well respected by the JNI launching code
# in jsvc. On Apple Java systems, you are better off setting JAVA_JVM_VERSION
# to the proper java name, such as 1.4, 1.5, or CurrentJDK, and let JAVA_HOME
# be calculated from that.
#

# First source the conf/setenv.local file to allow user to configure environment
# in an even more minimal fashion.
if [ -r "$CATALINA_HOME/conf/setenv.local" ]; then
    . "$CATALINA_HOME/conf/setenv.local"
fi

# Attempt to set JAVA_HOME if it's not already set
if [ -z "$JAVA_HOME" ]; then

    # Set JAVA_JVM_VERSION and JAVA_HOME for Darwin
    if [ `uname -s` = "Darwin" ]; then

        # Look for a java version specified by JAVA_JVM_VERSION, falling back to current version
        # Set JAVA_HOME to reflect the version
        for jversion in $JAVA_JVM_VERSION CurrentJDK ; do
            jhome="/System/Library/Frameworks/JavaVM.framework/Versions/${jversion}/Home"
            if [ -z "$JAVA_HOME" -a -d "${jhome}" ]; then
                # Get the actual version that any symlink points to, since
                # jni doesn't like JAVA_JVM_VERSION set to CurrentJDK
                saved=`pwd`
                cd "/System/Library/Frameworks/JavaVM.framework/Versions/${jversion}"
                actualvers=$(basename $(pwd -P))
                cd $saved

                export JAVA_JVM_VERSION=${actualvers}
                export JAVA_HOME=${jhome}
            fi
        done

    fi

fi

setenv.local:

#!/bin/sh 
#
# setenv.local
#
# This script, if present, is executed by tomcatctl through setenv.sh
# in order to set up any environment prior to executation of tomcat.
#

# For Apple Java, JAVA_JVM_VERSION may be used to specify a particular  
# java version to run. It should be something like 1.4, 1.5, or CurrentJDK.
#export JAVA_JVM_VERSION=1.5

catalina.sh(部分,文件很长):

#JAVA_OPTS="-Xmx4096m -Xms4096m -XX:PermSize=6144m -XX:MaxPermSize=6144m $JAVA_OPTS"
CATALINA_OPTS="-Xmx4096m -Xms4096m -XX:PermSize=6144m -XX:MaxPermSize=6144m $CATALINA_OPTS"

0 个答案:

没有答案