JVM 监控--jvisualvm

  • jvisualvm是jdk自带的监测工具,在windows命令行中即可启java

    启动命令:shell

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\my>jvisualvm

C:\Users\my>

The launcher has determined that the parent process has a console and will reuse
 it for its own console output.
Closing the console will result in termination of the running program.
Use '--console suppress' to suppress console output.
Use '--console new' to create a separate console window.

启动以后能够查看本地运行的java进程windows


  • 配置服务器端服务器

    jvisualvm 链接服务器有两种方式ide

    1.Jstatd工具

    2.JMX命令行

配置jstatd以后能够链接远程服务器,监控全部的java进程code

my.policyserver

grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};

JMX能够监控特定的应用进程进程

jstatd -J-Djava.security.policy=/home/my/spider/test/my.policy -J-Djava.rmi.server.logCalls=true

配置以后发现,本地jvisualvm比较占用内存,响应比较慢。

jmx链接不成功

相关文章
相关标签/搜索