• 谈谈jconsole和jvisualvm


    环境Eclipse-Mars ,JDK1.7

    JConsole

    一、首先需要配置参数

    参数有两种配置连接方式:(原理我还不太懂)

    1、在eclipse中添加

    项目右键-->>Debug as -->> Debug Configuarations -->>Arguments -->>VM Arguments添加如下参数

    -Dcom.sun.management.jmxremote

    -Dcom.sun.management.jmxremote.port=8011

    -Dcom.sun.management.jmxremote.ssl=false

    -Dcom.sun.management.jmxremote.authenticate=false

    2、在配置文件中添加

    C:eclipse下找到eclipse.ini文件,打开添加

    注意:我看到网上有人说用以下参数,但是我的运行显示报错,端口已经在使用

    -Dcom.sun.management.jmxremote.port=9999
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false

    二、启动JConsole

    C:Program FilesJavajdk1.7.0_67in下,双击jconsole.exe

    JVisualvm

    原博:写的太赞了:http://jiajun.iteye.com/blog/1180230

    一、连接

    1、本地机器的程序直接可以监听到

    2、远程机器的程序需要加上JVM参数

    -Dcom.sun.management.jmxremote= true
    -Dcom.sun.management.jmxremote.port= 9090
    -Dcom.sun.management.jmxremote.ssl= false
    -Dcom.sun.management.jmxremote.authenticate= false
    备注:另外需要检查

    hostname -i

    看解析出来是否为本地的IP,如是127.0.0.1或者IP为多个IP中之一,则其他的IP无效,会连接不上。

  • 相关阅读:
    HDU 1573: X问题
    HDU 1370: Biorhythms
    Break Number --AtCoder
    Cat Snuke and a Voyage --AtCoder
    Fennec VS. Snuke --AtCoder
    Splitting Pile --AtCoder
    Sharing Cookies --AtCoder
    GLB串
    派(Dispatch)
    你知道那棵杨树底下有什么吗
  • 原文地址:https://www.cnblogs.com/wangwanchao/p/5309781.html
Copyright © 2020-2023  润新知