jconsole

Jconsole cannot connect

…衆ロ難τιáo~ 提交于 2019-12-04 03:19:01
I am using VNC to connect to a server. I am able to VNC into the server, and open Jconsole, but cannot get it to connect to my process whether I include the PID or try connecting using the GUI. The weird thing is all the processes show up in the GUI. See below. I get this when I try connecting: Followed by Is there something I need to do in order to get Jconsole working locally on a Linux server over VNC? Arnab C. Fix found here : You need to pass to the VM: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -- Edit - Fixed the =fals error mentioned in comments. In

JVM学习总结五(番外)——JConsole

对着背影说爱祢 提交于 2019-12-04 02:17:02
之前本来打算结合自己写的小程序来介绍JConsole和 VisualVM 的使用的,但是发现很难通过一个程序把所有的场景都体现出来,所以还是决定用书中的典型小例子来讲更加清晰。 一、JConsole的基本功能 JConsole是一个机遇JMX (Java Management Extensions,即Java管理扩展) 的JVM监控与管理工具,监控主要体现在:堆栈内存、线程、CPU、类、VM信息这几个方面,而管理主要是对JMX MBean( managed beans ,被管理的beans,是一系列资源,包含对象、接口、设备等 )的管理,不仅能查看bean的属性和方法信息,还能够在运行时修改属性或调用方法。 首先我们看下JConsole的启动, JConsole在jdk/bin/下,其启动需要图形界面的支持(废话,都说了图形界面),可能不少人一听到这个就觉得有点low:平时服务器跑的linux都没图形界面,那岂不是用不了。其实不用担心,JConsole支持远程进程监测。下边是连接界面,其实相当于jps命令: 再来看下连接后的界面,我们打开DeadLock(一个测试死锁的示例): 可以看到上边的选项卡正好对应各个功能。 1、概述 这个不介绍了,就是上图,相信大家都看的懂。 2、内存 在内存页我们可以看到程序运行期间JVM各个部分的内存状况,右下角是对应各个分区的内存使用柱状图

使用JDK进行Performance Tuning

给你一囗甜甜゛ 提交于 2019-12-03 18:44:48
JDK里有三个很好用的工具, jmap , jconsole 和 jvisualvm ,三个工具都各有所侧重,但是如果你的系统遇到性能瓶颈(内存不足或是CPU占用率过高),你可以通过这三个工具来发现应用里的hot spot。我今天只记一下大概的用法,给自己做个备忘,详细的使用说明,等忙完了这段时间,整理一下。 先介绍一个小工具,jps,这也是jdk自带的工具之一,可以列出系统里所有的java进程。 jmap可以查看程序中堆的使用情况,具体的用法是: jmap –histo:live <pid>; 以及可以将堆dump到一个文件,命令是: jmap –dump:format=b,file=heap.bin <pid>; 请在<pid>处填入相应的进程的id。 jconsole可以查看某个java进程的内存使用、CPU占用率等, 如果想要远程查看某一java程序,则需要在该程序启动参数里加下如下参数: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port= 9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false 上文使用的9001是监听的端口号,你可以指定其他的值

Tomcat配置Jconsole , JvisualVm 监控配置

China☆狼群 提交于 2019-12-03 18:44:39
Java内置有jconsole监控工具,可以监控CPU、内存、线程、类加载等信息,但以服务方式启动的tomcat不能被jconsole识别,在网上查找了一通,发现可以通过配置JAVA_OPTS方式启动RMI远程监控接口,能够使用jconsole监控tomcat,把方法记录一下,以供以后备查: 在Tomcat的配置界面中找到Java选项卡,在Java Options框的最下方增加以下内容: -Djava.rmi.server.hostname=172.16.18.155 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port="18081" -Dcom.sun.management.jmxremote.authenticate="false" -Dcom.sun.management.jmxremote.ssl="false" 其中注意 -Djava.rmi.server.hostname=172.16.18.155中的IP地址要写成本机配置的IP,也可以配置成0.0.0.0,不然有可能会导致监听不能正常启动 启动后运行jconsole 在界面中选择远程进程,填写 localhost:18081,用户名和密码为空,点击连接即可 tomcat内存配置: -XX:PermSize=128M -XX

使用JMX透过防火墙远程监控tomcat服务

允我心安 提交于 2019-12-03 18:44:25
JDK的bin目录下有jvisualvm或jconsole可以监控本地和远程jvm实例的运行动态(包括cpu,内存等), 对于性能分析或内存泄露分析等极其方便。下面介绍如何通过这两个工具远程监控有防火墙的linux上的tomcat服务。 废话少说,直接上正题: 我的测试环境是:centos 6.2(IP为192.168.1.118)上通过jsvc将tomcat 7作为服务启动。 1. 下载http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-7/v7.0.28/bin/extras/catalina-jmx-remote.jar并放在tomcat7的$CATALINA_BASE/lib目录。 2. 修改tomcat7的$CATALINA_BASE/conf/server.xml,在<Server port="8005" shutdown="SHUTDOWN"> 下加入监听器: <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" /> 3. 建立文本文件$CATALINA_BASE/conf/jmxremote

Better options to view JMX beans other than Jconsole [closed]

六眼飞鱼酱① 提交于 2019-12-03 17:03:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . JConsole has quiet a buggy view to monitor JMX published counters. What are the other alternatives ? I am unable to find any, other than JVisualVM which in effect uses the same view 回答1: Some alternatives are (since I'm fine with JVisulaVM I haven't tried them yet): JRockit Mission Control (will be added as Java

Strategies for the diagnosis of Java memory issues

亡梦爱人 提交于 2019-12-03 16:15:36
I've been tasked with debugging a Java (J2SE) application which after some period of activity begins to throw OutOfMemory exceptions. I am new to Java, but have programming experience. I'm interested in getting your opinions on what a good approach to diagnosing a problem like this might be? This far I've employed JConsole to get a picture of what's going on. I have a hunch that there are object which are not being released properly and therefor not being cleaned up during garbage collection. Are there any tools I might use to get a picture of the object ecosystem? Where would you start? Paul

记一次dbcp数据库连接池问题分析

梦想的初衷 提交于 2019-12-03 14:48:21
最开始使用数据库连接池 DBCP 是在公司的项目中,使用 Spring+MyBatis 直接简单的设置了一些参数就拿来用了。因为配置的部分也是其他同事做好的,所以对于 DBCP 也没有深入了解过。 后来帮同学写一点服务器代码,没有用其他任何框架只是使用 DBCP 数据库连接池来管理数据库连接。在这个过程中发现程序直接执行到被挂起,但是程序并没有执行完。 我使用的dbcp数据库连接池的版本是1.x,下图是我依赖的包文件的示意图 图1 dbcp版本 下面的代码只是为了还原问题的情况的代码,这是比较糟糕的代码,请不要在实际中这样写。代码只是使用BasicDataSource获得连接,而不关闭连接。 import java.sql.Connection; import java.sql.SQLException; import org.apache.commons.dbcp.BasicDataSource; public class Start { private static BasicDataSource dbcp = new BasicDataSource(); static{ dbcp.setDriverClassName("com.mysql.jdbc.Driver"); dbcp.setUsername("tim"); dbcp.setPassword("123456");

How to have JMX bind to a specific interface?

我的梦境 提交于 2019-12-03 11:06:36
问题 I am currently starting my Java VM with the com.sun.management.jmxremote.* properties so that I can connect to it via JConsole for management and monitoring. Unfortunately, it listens on all interfaces (IP addresses) on the machine. In our environment, there are often cases where there is more than one Java VM running on a machine at the same time. While it's possible to tell JMX to listen on different TCP ports (using com.sun.management.jmxremote.port ), it would be nice to instead have JMX

jps process information unavailable - jconsole and jvisualvm not working

有些话、适合烂在心里 提交于 2019-12-03 10:08:38
After a windows update, my jps, jconsole et jvisualvm are not working anymore. Jps gives me the process ids, but it tells me process information unavailable And I'm unable to connect to those processes with jvisualvm as I used to. I'm running the 1.6.0_22 jre. I already had the problem in the past, tries this trick , and it worked. But this time, bad luck, it does not help. Edit : I found a solution : in my temp folder, I did destroy the hsperfdata_<username> folder. Apparently there was an issue with the case of my username. The folder was called hsperfdata_myname. After having been destroyed