简体   繁体   English

在tomcat的catalina.sh中设置-server

[英]Setting -server in tomcat's catalina.sh

I am using Apache Tomcat 7.0.30 & JDK 1.7.0_71 我正在使用Apache Tomcat 7.0.30和JDK 1.7.0_71

I have set -server JVM argument in tomcat's catalina.sh 我在tomcat的catalina.sh中设置了-server JVM参数

JAVA_OPTS="$JAVA_OPTS -Xms4096M -Xmx6144M -XX:PermSize=512M -XX:MaxPermSize=512M -server"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=14888"

How to check if tomcat is running in server mode ? 如何检查tomcat是否在服务器模式下运行?

Can I check it using Visual VM ? 我可以使用Visual VM进行检查吗? By connecting to that tomcat using JMX port ? 通过使用JMX端口连接到该tomcat? If yes, then where exactly it will be visible in Visual VM ? 如果是,那么它将在Visual VM中确切显示在哪里?

You have -Xms4096M in your JAVA_OPTS . 您的JAVA_OPTS-Xms4096M That will only work if you have a 64-bit JVM. 仅当您具有64位JVM时,这才有效。 IFAIK, 64-bit Java VMs run exclusively in server-mode. IFAIK,64位Java VM 在服务器模式下运行。 So, I think you're in server mode with or without -server , here. 因此,我认为您处于带或不带-server服务器模式。

To check the server mode under VisualVM, look on the "Overview" tab once you've connected to the remote JVM. 要检查VisualVM下的服务器模式,连接到远程JVM后,在“概述”选项卡上查找。 Under the "JVM" heading, it will tell you what's running. 在“ JVM”标题下,它将告诉您正在运行什么。 For example: 例如:

JVM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02, mixed mode)

That's a "server" JVM running, there. 那是一个正在运行的“服务器” JVM。

Additionally, you should be using CATALINA_OPTS instead of JAVA_OPTS for that huge heap. 此外,对于该巨大堆,应该使用CATALINA_OPTS而不是JAVA_OPTS Otherwise, you need a 4GiB heap just to launch the "tomcat stop" command. 否则,您仅需要4GiB堆来启动“ tomcat stop”命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM