简体   繁体   English

使用VisualVM监视Java应用程序

[英]Monitor Java application with VisualVM

I have a few Java programs running on my EC2 instance. 我在EC2实例上运行了一些Java程序。 I want to profile them using VisualVM. 我想使用VisualVM对它们进行概要分析。 they are not web applications that run on Jetty or Tomcat. 它们不是在Jetty或Tomcat上运行的Web应用程序。 I did go through the stuff mentioned here , but I dont know how to set up my VisualVM after I generate the jar files with those commands. 我确实经历了这里提到的内容,但是在使用这些命令生成jar文件之后,我不知道如何设置VisualVM。 Can some help me out? 可以帮我吗?

Thanks 谢谢

You normally attach VisualVM to the PID of the process you want to profile. 您通常将VisualVM附加到要分析的进程的PID。 If that's Jetty or Tomcat or some other Java EE app server, that means the PID of the app server. 如果是Jetty或Tomcat或其他Java EE应用服务器,则表示应用服务器的PID。 If not, it's the PID of the JVM that's running your app. 如果不是,则是运行您的应用程序的JVM的PID。

If you've already got a JVM installed on your EC2 instance, I'd recommend looking in the JVM /bin folder to see if jvisualvm.exe is already there. 如果您已经在EC2实例上安装了JVM,建议您在JVM / bin文件夹中查找jvisualvm.exe是否已存在。 If it is, fire it up in a separate command shell and attach it the PID of your application. 如果是这样,请在单独的命令外壳中启动它,并将其附加到应用程序的PID中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM