版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/qq_15764943/article/details/85019148
JVisualVM监控简单使用
JVisualVM
VisualVM是Netbeans的profile子项目,已在JDK6.0 update 7 中自带(java启动时不需要特定参数,监控工具在bin/jvisualvm.exe),能够监控线程,内存情况,反向查看分配的堆栈等,几乎包含JDK自带命令的所有功能。
监控远程tomcat
1、进入Tomcat/bin目录,修改catalina.sh
2、添加一下配置
CATALINA_OPTS=”$CATALINA_OPTS
-Dcom.sun.management.jmxremote
-Djava.rmi.server.hostname=192.168.164.110
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false”
监控远程JAR
如:springboot微服务项目,启动添加参数
nohup java -Dcom.sun.management.jmxremote
-Djava.rmi.server.hostname=192.168.164.110
-Dcom.sun.management.jmxremote.port=9998
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false -jar demo.jar &