Troubleshooting performance bottlenecks in your Java application or service can help you better understand where you’re wasting resources with inefficient processing. Additionally, if an incident occurs, you want to know what happened during the incident and what performance issues led up to it. To make such troubleshooting faster and easier, you need to see the high-fidelity runtime characteristics of your code running on the JVM—and you need that data in real time.

To that end, New Relic is excited to announce the availability of real-time Java profiling and the JVM cluster timeline view. Because of its low overhead, you can use real-time Java profiling in production environments to run continuous profiling of your Java code. The accompanying JVM cluster timeline view provides a fast and intuitive way to diagnose cluster-wide performance problems; for example, you can now quickly see how an application’s deployment affects the overall health of the cluster.

Real-time Java profiling—a community-driven project

The profiling data New Relic uses for real-time Java profiling comes from the contributions of the Java community. After the release of JDK 9, Oracle changed the release model of Java and open-sourced the Java Flight Recorder (JFR). Java 14 enhanced JFR so that it can now produce a continuous stream of profiling events; event handling is done immediately via API rather than by parsing a file after the fact. This change makes JFR Event Streaming a great foundation on which to enhance observability tools. (To learn more about JFR and JFR Event Streaming, check out this article from our own Ben Evans.)

Understand JVM cluster behavior over time

The JVM cluster timeline view shows you JVM behavior across the entire cluster. This timeline enables quicker troubleshooting and issue detection; for example, at a glance you can see:

  • How a recent deployment affected the rest of the JVM cluster
  • When and why a JVM restarted
  • How a particular instance was affected by its noisy neighbor

Speed troubleshooting with the JVM cluster timeline view

Each row of the timeline represents a specific JVM over time. Inside each row, a box represents a 5-minute period of that JVM’s life. Yellow, orange, and red traffic lights indicate anomalous behavior for a JVM, so you can drill down into that instance and the right time period when investigating errors or other performance issues.

The details panel for each JVM provides three critical views:

1. How resources are allocated within a process

In the detailed view of a JVM, the per-thread allocation buffer (TLAB) allocations graph shows you which threads are allocating the most resources. From this graph, you can see the individual events where new allocation buffers are handed out to application threads, which provides a much more accurate view of resources within a process.

 2. How garbage collection affects performance

The garbage collection (GC) graph shows garbage collection events over the lifetime of a JVM. The longest pause indicates where long garbage collection events have occurred over the selected time period while the overall time shows the total time spent in GC within a given time period.

3. How to track garbage collection with Logs. If you’ve enabled New Relic Logs, you can view logs for your Java application with data from the garbage collection graph to find transactions caught up in long garbage collection pauses.

Get started with real-time Java profiling in New Relic One

Real-time Java profiling and the cluster timeline view are available in New Relic One, where you can incorporate this real-time profiling with other critical observability data. In the future, we plan to expand the capabilities of the real-time Java profiling to integrate with other parts of the New Relic platform, like Thread profiling, New Relic Alerts, distributed tracing, and New Relic Infrastructure.

To learn more about requirements and how to get started, check out the documentation. If you have any feedback, let us know.

Want to learn more about what’s happening in the Java ecosystem? Don’t miss The State of Java: Trends And Data For One of the World’s Most Popular Programming Languages.

Abhi Arora is a Senior Product Manager on the New Relic Java Agent team. View posts by .

Interested in writing for New Relic Blog? Send us a pitch!