VisualVM远程连接并监控服务器上的jvm进程

有两种方式,一种使用RMI框架(Remote Method Invoke 远程方法调用),RMI框架详解:http://haolloyin.blog.51cto.com/1177454/332426/。一种使用JMX(Java Management Extensions,即Java管理扩展), JMX是一个为应用程序、设备、系统等植入管理功能的框架。它们两个在VisualVM中提供的功能都不完善,RMI缺少CPU监控而JMX缺少VisualGC。

第一种方式: 通过jstated启动RMI服务见http://www.blogjava.net/titanaly/archive/2012/03/20/372318.html

第二种方式:配置JMX远程监控jvm

1. Run LongSleep.java with the JMX agent turned on without requiring any connection authentication or SSL certificate:

C:\herong>\progra~1\java\jdk1.8.0\bin\java
   -Dcom.sun.management.jmxremote.port=6789 
   -Dcom.sun.management.jmxremote.authenticate=false
   -Dcom.sun.management.jmxremote.ssl=false
   LongSleep

2. Run Java VisualVM and click "File > Add JMX Connection..." menu. You will see a dialog box displayed.

3. Enter "localhost:6789" in the "Connection" field and click OK. You will see that VisualVM connects to the LongSleep.java JVM through the JMX agent.

Once connected, you can monitor the remote JVM in the same way as a local JVM.

The picture below shows File menu entries for connecting Java VisualVM to JVM processes running on a remote machine: 





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值