JMX vs VisualVM? - java

I read couple of links about JMX and VisualVM, but still have a couple of questions around them.
As per my understanding, JMX & VisualVM are 2 different JVM monitoring tools. In-addition, JMX has APIs, which a java application could incorporate and allow the monitoring tools to better monitor the application.
Could someone clarify if this understanding is correct or flawed ? If flawed, could you please point to any articles explaining this difference/comparison better ?
Also, when do i go for using JMX or VisualVM to monitor my java based web application hosted on a Tomcat 6.1 server ?

That's not correct. JConsole & Java VisualVM are 2 different JVM monitoring tools. Java Management Extensions (JMX) is a Java technology that supplies tools for managing and monitoring applications, like JConsole or Java VisualVM

Related

JAVA heap size monitoring on Linux

I am looking for a way to pull heap sizes (min, max, used) from a Java process on Linux. I need a lightwaight tool/command to use to do the job. Big monitoring packages are not an option.
I done some googleing and more but could not find a viable alternatives. The only possible option that I found so far is to use JMX protocol. I enabled JMX on Java appication and was succesfully poll it using various java tools that use JMX protocol/library implementation. But these Java tools are slow, taking much cpu during startup when allocating memory. What I want is a simple tool command line that would talk for example JMX protocol and poll the process for heap sizes.
I am using IBM's J9 version of Java and jstat tool is not available there.
Any ideas anyone?
Your need has probably been taken care of by now but one option, for others who might stumble on this thread, is a tool called 'jvmtop' (link: https://code.google.com/p/jvmtop/). It works with the IBM J9 JVM (among others).

How to profile a headless Java application, running remotely?

I have a headless Java application, running on a remote server as a daemon-style process.
I want to extract Java level profiling information from the process, of the sort displayed by JVisualVM. For example, it should show method invocation times and so on.
What is the best way of doing this? My understanding is that JVisualVM does not profile when connecting remotely.
Ideally, the profiling information would be stored in a file for later inspection, in a manner similar to Java heap generation (with jmap) and later analysis (with a heap inspector).
You can use NetBeans profiler remote profiling capability.
Remote Profiling
Profile an application that is running on a different system than your NetBeans IDE. The profiler's remote pack can be installed on a remote system, allowing you to profile an application that is started on that system.
In fact, VisualVM is based on it.
Beside various monitoring features, the tool contains a built-in profiler based on the NetBeans profiler. While the profiler UI in VisualVM looks simple (especially when compared to the NetBeans profiler), the profiling capabilities are almost as powerful as in NetBeans.
Here is a detailed blog post about Profiling a Java remote server using Netbeans.
According to the link you will have to set up jstatd and jmx:
http://javadevsoup.blogspot.de/2012/02/remote-java-profiling-using-visual-vm.html
I just found another product that I think does this: http://chrononsystems.com/products/chronon-recording-server

Tools to JVM/AS monitoring

I'm researching about the tools that are helpful to monitoring the JVM(memory, processor, number of threads) and/or the use of Application Server resources during the application production (requests, number of the EJBs in the pool etc etc).
I know only the jconsole and the VisualVM
What else Do you know? For what purpose do you use?
Thanks a lot =]
Thanks for the answers until now. Does someone know some tool to monitoring WebLogic?
Try JavaMelody also.
https://code.google.com/p/javamelody/
jhat - to get memory dump on server
jstack - to get traces for all current threads and see if there are deadlocks
jmap - for heap summary view
jstat - performance stats
those tools are console-based and easy to use on servers without GUI
WAS ISC has built-in PMI (Performance Monitoring Infrastructure) - it allows to collect all performance data per server that you mentioned.
You can check RHQ Platform. It allows you to manage and monitor not only JVM but also many other services. These solution is especially useful when you use some JBoss server.
But it also quite complicates and better suited for production environment.
Here is link: http://www.jboss.org/rhq
The official tool of IBM for Websphere Monitoring is the IBM Tivoli Composite Application Manager for Application Diagnostics (ITCAM for AD) which together with IBM Tivoli Monitoring (ITM) Platform gives you a complete picture of what is happing in your production server along with alerts, historical data, some actions when an event happens etc.
Alternatively you may try solutions such as Health Center provided with Support Assistant or use an open source monitoring system such as Nagios and use plugins that can monitor the Websphere environment.
If you just want to troubleshoot a problem quickly and not need a full monitoring product with alerts, historical data etc you may just use the Performance Viewer app (located in Monitoring and Tuning > Performance Viewer > Current Activity from Admin Console) to get all the metrics you mentioned.

Use of JMX and How to use for existing applications

We have distributed web application developed few years back on JDK 5.
How JMX will help this application?
1) Will it help me to monitor performance (Memory, CPU and Network & Disk IO)?
2) If so then application is deployed in multiple servers,how can I monitor in one single dashboard?
3) Do I have to make any new code changes to the existing application or can I monitor without code changes?
4) What else can we do apart from performance monitoring? Because name is Management Extensions (MX) what can we manage and how? It seems primary objective is not monitoring, it is management?
I couldn’t get much about JMX from the tutorial provided in Oracle website http://docs.oracle.com/javase/tutorial/jmx/overview/why.html. It seems some business representative prepared this tutorial not a techie.
Can anyone help me in understanding this JMX stuff, your efforts are sincerely appreciated.
Thanks,
Your Friend.
JMX is a standardized way of getting information out of a running system and to invoke operations on it. The JVM gives you a set of MBeans through which you can access runtime data like memory consumption, GC stats and some more data. You can also invoke a number of operations. Your app server will also give you a number of MBeans which you can use to control the server and installed applications.
Yes, it will give you some performance data. See http://docs.oracle.com/javase/1.5.0/docs/guide/management/overview.html for a list of resources.
This depends on your application server. If it support clustered environments, it will probably give you a dashboard.
If you are fine with the standard JVM and app server MBeans, you won't need do any changes. But you may want to write your own MBean to give specific application status and statistics or ways to control your application. See http://docs.oracle.com/javase/tutorial/jmx/mbeans/standard.html
Well, you can do anything you like in a standardized way.
Take a look at jconsole (included in the JDK) to see what JMX offers for you!

Profiling java application running as service(locally/remotely)

I'm looking for a tool which can profile the java application running as a windows service ( remotely/locally either way) .
I've come across VisualVM as one option. Are there any other products available other than VisualVm.I'm more interested in reputated product. Can Jprofiler do this for me?
VisualVM , Does it give class wise list of profiling ?
See this article, if you want to use Java VisualVM. It describes how java application running as a Windows service can be monitored and/or profiled using VisualVM.
JVisualVM is you best shot. It's free, comes with the JVM and gives you a pretty decent range of functionality. Not sure what you mean by "class wise list of profiling." But it will show you where the majority of your execution time is spent.
You can execute jvsiualvm by going to $JAVA_HOME/bin and typing jvisualvm. Then select the the vm you wish to profile.
You can use BTrace to instrument your application and to measure the parts of the application that you are interested in. BTrace logs its output to files, which you can later or in real-time transfer to a monitoring application, such as EurekaJ (which I've written myself).
Both tools are Open Sourced and free to use. BTrace uses the "GNU Public License v.2 w/Classpath Exception" license, while EurekaJ uses the GPLv3 license.
InfoQ Writeup on the two tool including VisualVM and a few commandline tools: http://www.infoq.com/articles/java-profiling-with-open-source
Link How can I monitor my Java application running as Windows Service with Visual VM? says that on recent Windows versions only JMX mode can be used, but not local.

Categories

Resources