我在AWS t2.medium linux实例(4GB RAM)中运行了tomcat 8.x,并且我试图设置tomcat内存,但出现错误
setenv.sh
export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=test"
export JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx2048m"
错误catalina.out
Invalid maximum heap size: -Xmx2048m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
但是,如果我设置以下内容,它将起作用
setenv.sh
export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=test"
export JAVA_OPTS="$JAVA_OPTS -Xms1024m -Xmx2048m -XX:PermSize=64m -XX:MaxPermSize=256m"
Java版本
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)