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鏈接不成功

相關文章
相關標籤/搜索