我尝试使用 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"