Sep 27, 2013

FlightRecorder in Java 7u40

Flightrecorder in JDK 7u40 - Come on Oracle

I visited two sessions at the JavaOne 2013 about the brand new flightrecorder in Java 7u40 for the hotspot JVM.

What is flightrecorder?

Flightrecorder is a sampling based profiler in combination with an event collection engine built into the JVM. Most of the code is  orginally from the JRocket virtual machine which Oracle got from the BEA/Weblogic aquisition. It is a comercial feature you have to unlock by using command line JVM startup parameters. For use in production you have to have a valid license. For development this is free to use.
The intresting thing is, that flightrecorder can run on production systems with very little overhead. The data can constantly collected in circular memory buffers and there are several policies available how to dump the data to disk which makes an offline analysis possible.
The profiler is sampling based and collects start/end times and an estimated (sampling) call count. It has a constant pool to record stack-traces for this calls very efficient. To do so, Oracle has modified the internal representation (in C) of classes and added a Class-Id to each class. Calls to their internal API (undocumented and unsupported) are build direct in the JVM. Other data which is collected by flightrecorder already exists like GC statistics or heap metrics. Yes you have read right: Oracle changes the JVM internally for support of their proprietäry products.

Oracle has build on top of that a eclipse based tool which is called "mission control". If you download an Oracle JDK 7u40 the tool is located in the jdk/bin folder.

The tool looks nice but for professional performance analysis we need much more.
  • flightrecorder is currently not open for application based events. For example: In a banking application we have to know to which bank money is transferd. Otherwise the profiler statistic says nothing because we need to know which bank causes the problem in our transaction. So events have to be enriched witch context information. 
  •   flightrecorder has this capabilities but there is currently no public API for application events or context enrichment.
  • flightrecorder has to have a remote interface to poll events. That is needed if you want to record constantly.
  • The dataformat of the dumpfile is not open nor there is any API to get the data. So you can not write you own analysis tool for a flightrecorder dump. This is needed when you want to do own statistics on the data.

Healthcenter for the IBM JVM

The IBM JVM has the same concept build in their own Virtual Machine. But they have a public API for tool developers. It enables developers to access all profiling or monitoring data remotly. So you
can write you monitoring tool which constanly consumes the data from the IBM JVM. That is currently not possible with flightrecorder and the Oracle hotspot JVM.
The businesscase of IBM seems to be based on a support model. If you have a support contract with IBM for you JVM you get the API for free.  I saw a presentation at the JavaOne where IBM presented the healthservices and their API. One thing I am absolute agree with them is, you can not write the one and only monitoring, profiling, analysis tool. Without open APIs the hole thing gets worthless.

Come on Oracle

What we really need is a public API to collect our own events and to implement our own storage policy for long term evaluation our datacenters, cluster or distributed applications.

Johannes Weigend

No comments:

Post a Comment