Introduction
VisualVM is a very powerful and convenient tool for visualizing local and remote java applications. These days, I use it for visualizing camel routes, memory usage, and many other things.Start VisualVM
VisualVM comes with JDK 7 under %JAVA_HOME%\bin\jvisualvm
When you start this application, you may encounter the error page below. This seems no-harm error. The work-around to avoid this problem is show on the troubleshooting page:
https://visualvm.java.net/troubleshooting.html. I fixed this problem by changing the directory hsperfdata_GLIU to hsperfdata_gliu. The hsperfdata_gliu directory is at %TMP% for windows.
https://visualvm.java.net/troubleshooting.html. I fixed this problem by changing the directory hsperfdata_GLIU to hsperfdata_gliu. The hsperfdata_gliu directory is at %TMP% for windows.
Install Plugins
After you start the VisualVM, you will see the local currently running application. That is fine if you just want to browse the local applications with minimum information, such as jvm startup options, threading etc. However, as java developer, you probably want to have more plugins. VisualVM plugins center comes with 16 plugins at this time or writing. I selected and installed all of them.
Connect To Remote Applications
To connection applications running on remote servers are very useful feature of VisualVM. It comes with 2 mechanisms, namingly JMX and stated. To me jmx is the choice, as my currently project is about enterprise integration using Talend ESB which is basically running on top of Apache ServiceMix.
The following is the procedure to connection Apache Karaf application:
Connect Apache Karaf - right client on the newly added node - select JMX option.
on the URL I entered the following:
service:jmx:rmi://acldlu02tld.corp.vha.com:44444/jndi/rmi://acldlu02tld.corp.vha.com:1099/karaf-trun
You can achieve this by using jconsole, but jconsole will not remember all your connections like visualvm.
"It is apparent attempt to let you visit the VisualVM home page. Thus just click OK." - really no:o) Your local jvmstat is broken, that's the true reason for this message.
ReplyDeleteThanks for the comments. I updated the text.
Delete