VisualVM monitoring like jconsole


How To Get VisualVM
The best part of VisualVM is that it's in your JDK bin directory already, if you've got any version of JDK1.6 since update 7. To run it, just click on the jvisualvm.exe icon.
All you need to do is click on the jvisualvm.exe and the application starts up. All Java applications running will be displayed on the right hand side navigation bar. Note that there is no need to register your application with VisualVM - it'll appear automatically. You can also view remote applications in this navigator.
JVM Arguments that needs to be added in eclipse or ant file or command prompt for remote monitoring:
-Dcom.sun.management.jmxremote.port=7878 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

How to get jVisualVm?
For Test the JVisualVM:
Step 1> Create a standalone java program or web application program
Step 2>Stand Alone java program Example
   A>
package com.jconsole.example;
public class ThreadProcess implements Runnable{
@Override
public void run() {
int count=0;
while(true){
System.out.println("Count method test by JConsole"+count++);
}
}
}
B>
package com.jconsole.example;
public class ThreadProcessDemo {
public static void main(String[] args) {
     ThreadProcess tProcess=new ThreadProcess();
     Thread t=new Thread(tProcess);
     t.start();
     System.out.println("Main Thread is running");
}
}
Step 3>
Run this Standalone java program
Step 4>
Goto jdk installation path.
like:
C:\Program Files\Java\jdk1.7.0_45\bin\
Step 5> Double Click or run jvisualvm.exe file
For more information
Previous
Next Post »