Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

How to monitor JVM



Hei,
We are a group of students who work on a project for a company. We are trying to monitor JVM using java plungins in a munin server. The problem is tha values that we get are non changable even if we load our JVM, in contrary of the JConsole, all the values of JVM changes constantly. What seems to be the problem? Please help!

Here is an example of the java code we used:

String nyclasser=ManagementFactory.GARBAGE_COLLECTOR_MXBE AN_DOMAIN_TYPE;
RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
List ny=ManagementFactory.getMemoryManagerMXBeans();
CompilationMXBean CMXbean=ManagementFactory.getCompilationMXBean();
int stor=ny.size();

System.out.println("getboootClassPath------->"+mxbean.getBootClassPath()+"\ngetLibraryPath------>"+mxbean.getLibraryPath()+"\nGARBAGE_COLLECTOR_MX BEAN_DOMAIN_TYPE----->"+nyclasser+"\nsize------>"+stor+"\ngetManagementSpeceVersion----->"+mxbean.getManagementSpecVersion()+"\ngetName---------->"+mxbean.getName()+"\ngetVmVersion---->"+mxbean.getVmVersion()+"\ngetVmVendor----->"+mxbean.getVmVendor());
System.out.println("getStartTime------>"+mxbean.getStartTime()+"\nisBootClassPathSupport ed------>"+mxbean.isBootClassPathSupported());
System.out.println("CompilationMXBean.getName----->"+CMXbean.getName()+"\nCompilationMXBean.getTotal ComilationTime---->"+CMXbean.getTotalCompilationTime());
foreach(MemoryManagerMXBean m in ny)
{

}

In JConsole we get a list of applications to choose to monitor , how can we do the equivalent in our little application ?