# JDK Flight Recorder

JDK Flight Recorder (JFR) is an observability, monitoring, profiling, and event-collection framework built into the HotSpot JVM and JDK for debugging and analyzing Java applications.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Tracking Java Native Memory With JDK Flight Recorder

DevFeed: [Tracking Java Native Memory With JDK Flight Recorder](<https://devfeed.tech/articles/tracking-java-native-memory-with-jdk-flight-recorder-18885.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/tracking-java-native-memory-with-jdk-flight-recorder/>)

Published: 2023-12-17T18:29:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Java](<https://devfeed.tech/topics/java.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [memory](<https://devfeed.tech/tags/memory.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [performance](<https://devfeed.tech/tags/performance.md>), [streaming](<https://devfeed.tech/tags/streaming.md>)

### AI overview

This article explains how JDK Flight Recorder can continuously track Java native memory usage through Native Memory Tracking data. It covers the relevant JFR event types introduced in Java 20, example off-heap allocations, and streaming the data to monitoring dashboards.

### Source excerpt

Table of Contents An Example Tracking RSS As regular readers of this blog will now, JDK Flight Recorder (JFR) is one of my favorite tools of the Java platform. This low-overhead event recording engine built into the JVM is invaluable for observing the runtime characteristics of Java applications and identifying any potential performance issues. JFR continues to become better and better with every new release, with one recent addition being support for native memory tracking (NMT).

## Finding Java Thread Leaks With JDK Flight Recorder and a Bit Of SQL

DevFeed: [Finding Java Thread Leaks With JDK Flight Recorder and a Bit Of SQL](<https://devfeed.tech/articles/finding-java-thread-leaks-with-jdk-flight-recorder-and-a-bit-of-sql-18819.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/finding-java-thread-leaks-with-jdk-flight-recorder-and-bit-of-sql/>)

Published: 2023-02-28T21:16:10Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Java](<https://devfeed.tech/topics/java.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [SQL](<https://devfeed.tech/topics/sql.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [performance-analysis](<https://devfeed.tech/tags/performance-analysis.md>), [root-cause-analysis](<https://devfeed.tech/tags/root-cause-analysis.md>), [sql](<https://devfeed.tech/tags/sql.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

This article explains how to investigate Java thread leaks with JDK Flight Recorder. It describes why thread leaks can cause memory and CPU problems, why thread dumps are limited, and how JFR events can reveal changing thread counts and the source of newly created threads.

### Source excerpt

The other day at work, we had a situation where we suspected a thread leak in one particular service, i.e. code which continuously starts new threads, without taking care of ever stopping them again. Each thread requires a bit of memory for its stack space, so starting an unbounded number of threads can be considered as a form of memory leak, causing your application to run out of memory eventually. In addition, the more threads there are, the more overhead the operating system incurs for scheduling them, until the scheduler itself will consume most of the available CPU resources. Thus it's vital to detect and fix this kind of problem early on.

## Identifying Blocked Producers in Java BlockingQueue with Profiling and JDK Flight Recorder

DevFeed: [Identifying Blocked Producers in Java BlockingQueue with Profiling and JDK Flight Recorder](<https://devfeed.tech/articles/is-your-blocking-queue-blocking-18839.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/is-your-blocking-queue-blocking/>)

Published: 2023-01-03T21:10:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [blocking](<https://devfeed.tech/tags/blocking.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [performance](<https://devfeed.tech/tags/performance.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

This tutorial explains how to detect producer threads blocked while adding work to a bounded Java BlockingQueue. It discusses wall-clock profiling with async-profiler and using custom JDK Flight Recorder events when profiling is unavailable.

### Source excerpt

Table of Contents Emitting Custom Events Filtering "Thread Park" Events Towards Real-Time Analysis of JFR Events Java's BlockingQueue hierarchy is widely used for coordinating work between different producer and consumer threads. When set up with a maximum capacity (i.e. a bounded queue), no more elements can be added by producers to the queue once it is full, until a consumer has taken at least one element. For scenarios where new work may arrive more quickly than it can be consumed, this applies means of back-pressure, ensuring the application doesn't run out of memory eventually, while enqueuing more and more work items.

## Running JDK Mission Control on Apple M1

DevFeed: [Running JDK Mission Control on Apple M1](<https://devfeed.tech/articles/running-jdk-mission-control-on-apple-m1-18867.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/running-jmc-on-apple-m1/>)

Published: 2022-05-17T08:20:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Mac Mini](<https://devfeed.tech/topics/mac-mini.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [Adoptium](<https://devfeed.tech/topics/adoptium.md>)

Tags: [adoptium](<https://devfeed.tech/tags/adoptium.md>), [apple-m1](<https://devfeed.tech/tags/apple-m1.md>), [arm](<https://devfeed.tech/tags/arm.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [mac-mini](<https://devfeed.tech/tags/mac-mini.md>), [macos](<https://devfeed.tech/tags/macos.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [permission](<https://devfeed.tech/tags/permission.md>), [plist](<https://devfeed.tech/tags/plist.md>)

### AI overview

A troubleshooting guide for running JDK Mission Control on an Apple M1 Mac. It explains that JMC is currently shipped as an x64 application, so configuring it to use an x64 Temurin JDK through Rosetta resolves the startup error, while other applications can continue using an AArch64 JDK.

### Source excerpt

JDK Mission Control (JMC) is invaluable for analysing performance data recording using JDK Flight Recorder (JFR). The other day, I ran into a problem when trying to run JMC on my Mac Mini M1. Mostly for my own reference, here's what I did to overcome it.

## The JDK Flight Recorder File Format

DevFeed: [The JDK Flight Recorder File Format](<https://devfeed.tech/articles/the-jdk-flight-recorder-file-format-18840.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/jdk-flight-recorder-file-format/>)

Published: 2022-02-20T20:15:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Java](<https://devfeed.tech/topics/java.md>), [openjdk](<https://devfeed.tech/topics/openjdk.md>), [Parser](<https://devfeed.tech/topics/parser.md>)

Tags: [format](<https://devfeed.tech/tags/format.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [openjdk](<https://devfeed.tech/tags/openjdk.md>), [parsing](<https://devfeed.tech/tags/parsing.md>)

### AI overview

This article examines the JDK Flight Recorder file format. It explains that JFR records high-performance runtime events in recording files, notes that the format has no official specification and is an OpenJDK implementation detail, and describes investigating its structure through JDK and JDK Mission Control source code.

### Source excerpt

The JDK Flight Recorder (JFR) is one of Java's secret weapons; deeply integrated into the Hotspot VM, it's a high-performance event collection framework, which lets you collect metrics on runtime aspects like object allocation and garbage collection, class loading, file and network I/O, and lock contention, do method profiling, and much more. JFR data is persisted in recording files (since Java 14, also "realtime" event streaming is supported), which can be loaded for analysis into tools like JDK Mission Control (JMC), or the jfr utility coming with OpenJDK itself.

## JDK Flight Recorder Events in GraalVM Native Binaries

DevFeed: [JDK Flight Recorder Events in GraalVM Native Binaries](<https://devfeed.tech/articles/jdk-flight-recorder-events-in-graalvm-native-binaries-18842.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/jfr-events-in-graalvm-native-binaries/>)

Published: 2021-11-12T17:30:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Java](<https://devfeed.tech/topics/java.md>), [Quarkus](<https://devfeed.tech/topics/quarkus.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [diagnostics](<https://devfeed.tech/tags/diagnostics.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>)

### AI overview

This tutorial explains that GraalVM native binaries support JDK Flight Recorder through GraalVM 21.2, although only a limited set of event types was initially available. It demonstrates enabling custom JFR events in a Quarkus application compiled as a native binary and notes the required configuration option.

### Source excerpt

If you have followed this blog for a while, you'll know that I am a big fan of JDK Flight Recorder (JFR), the low-overhead diagnostics and profiling framework built into the HotSpot Java virtual machine. And indeed, until recently, this meant only HotSpot: Folks compiling their Java applications into GraalVM native binaries could not benefit from all the JFR goodness so far.

## Introducing JfrUnit 1.0.0.Alpha1

DevFeed: [Introducing JfrUnit 1.0.0.Alpha1](<https://devfeed.tech/articles/introducing-jfrunit-1-0-0-alpha1-18835.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/introducing-jfrunit-1-0-0-alpha1/>)

Published: 2021-08-04T17:10:00Z

Content type: release

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Java](<https://devfeed.tech/topics/java.md>), [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Groovy](<https://devfeed.tech/topics/groovy.md>), [Maven](<https://devfeed.tech/topics/maven.md>)

Tags: [groovy](<https://devfeed.tech/tags/groovy.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [junit](<https://devfeed.tech/tags/junit.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [maven-central](<https://devfeed.tech/tags/maven-central.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The article announces JfrUnit 1.0.0.Alpha1, a JUnit extension for asserting JDK Flight Recorder events in unit tests. It describes uses including validating custom events, detecting potential performance regressions, and white-box testing with JMC Agent, and outlines setup and usage with Maven, Quarkus, Groovy, and Spock examples.

### Source excerpt

Table of Contents Getting Started With JfrUnit Groovier Tests With Spock Outlook Unit testing, for performance It's with great pleasure that I'm announcing the first official release of JfrUnit today! JfrUnit is an extension to JUnit which allows you to assert JDK Flight Recorder events in your unit tests. This capability opens up a number of interesting use cases in the field of testing JVM-based applications: You can use JfrUnit to ensure your application produces the custom JFR events you expect it to emit You can use JfrUnit to identify potential performance regressions of your application by means of tracking JFR events e.g. for garbage collection, memory allocation and network I/O You can use JfrUnit together with JMC Agent for whitebox tests of your application, ensuring specific methods are invoked with the expected parameters and return values

## Towards Continuous Performance Regression Testing

DevFeed: [Towards Continuous Performance Regression Testing](<https://devfeed.tech/articles/towards-continuous-performance-regression-testing-18884.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/towards-continuous-performance-regression-testing/>)

Published: 2020-12-16T16:45:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Development](<https://devfeed.tech/topics/development.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [database](<https://devfeed.tech/tags/database.md>), [functional](<https://devfeed.tech/tags/functional.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [latency](<https://devfeed.tech/tags/latency.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [orm](<https://devfeed.tech/tags/orm.md>), [performance](<https://devfeed.tech/tags/performance.md>), [regression](<https://devfeed.tech/tags/regression.md>), [sql](<https://devfeed.tech/tags/sql.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This article introduces JfrUnit, an open-source project for continuous performance regression testing. It explains how JfrUnit asserts expected values for indirect performance metrics such as memory allocation, database I/O, and executed SQL statements, using events from JDK Flight Recorder. These assertions can identify potential regressions in standard JUnit tests without relying on wall-clock time or production-like hardware.

### Source excerpt

Table of Contents Getting Started With JfrUnit Case Study 1: Spotting Increased Memory Allocation Case Study 2: Identifying Increased I/O With the Database Discussion Summary and Outlook Functional unit and integration tests are a standard tool of any software development organization, helping not only to ensure correctness of newly implemented code, but also to identify regressions -- bugs in existing functionality introduced by a code change. The situation looks different though when it comes to regressions related to non-functional requirements, in particular performance-related ones: How to detect increased response times in a web application? How to identify decreased throughput? These aspects are typically hard to test in an automated and reliable way in the development workflow, as they are dependent on the underlying hardware and the workload of an application. For instance assertions on the duration of specific requests of a web application typically cannot be run in a meaningful way on a developer laptop, which differs from the actual production hardware (ironically, nowadays both is an option, the developer laptop being less or more powerful than the actual production environment). When run in a virtualized or containerized CI environment, such tests are prone to severe measurement distortions due to concurrent load of other applications and jobs. This post introduces the JfrUnit open-source project, which offers a fresh angle to this topic by supporting assertions not on metrics like latency/throughput themselves, but on indirect metrics which may impact those. JfrUnit allows you define expected values for metrics such as memory allocation, database I/O, or number of executed SQL statements, for a given workload and asserts the actual metrics values -- which are obtained from JDK Flight Recorder events -- against these expected values. Starting off from a defined base line, future failures of such assertions are an indicator for potential performance regres

## Introducing JmFrX: A Bridge From JMX to JDK Flight Recorder

DevFeed: [Introducing JmFrX: A Bridge From JMX to JDK Flight Recorder](<https://devfeed.tech/articles/introducing-jmfrx-a-bridge-from-jmx-to-jdk-flight-recorder-18836.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/introducing-jmfrx-a-bridge-from-jmx-to-jdk-flight-recorder/>)

Published: 2020-08-18T15:30:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Java](<https://devfeed.tech/topics/java.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [blog-post](<https://devfeed.tech/tags/blog-post.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [tool](<https://devfeed.tech/tags/tool.md>)

### AI overview

This article introduces JmFrX, an open-source utility that periodically captures JMX MBean attributes into JDK Flight Recorder files. The recordings can be analyzed with JDK Mission Control, used to track values over time, examined offline, or exported as live data streams through the JFR event streaming API.

### Source excerpt

Table of Contents Why JmFrX? How To Use JmFrX Customizing Event Formats How It Works Takeaways I'm excited to share the news about an open-source utility I've been working on lately: JmFrX, a tool for capturing JMX data with JDK Flight Recorder. When using JMX (Java Management Extensions), The Java platform's standard for monitoring and managing applications, JmFrX allows you to periodically record the attributes from any JMX MBean into JDK Flight Recorder (JFR) files, which you then can analyse using JDK Mission Control (JMC).

## Using JDK FlightRecorder and JDK Mission Control

DevFeed: [Using JDK FlightRecorder and JDK Mission Control](<https://devfeed.tech/articles/using-jdk-flightrecorder-and-jdk-mission-control-26076.md>)

Original publisher: [Read original article](<https://blog.arkey.fr/2020/06/28/using-jdk-flight-recorder-and-jdk-mission-control/>)

Author: brice.dutheil@gmail.com (Brice Dutheil)

Published: 2020-06-28T21:54:58Z

Content type: tutorial

Language: en

Sources: [The Coffee Workshop](<https://devfeed.tech/sources/the-coffee-workshop.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Java](<https://devfeed.tech/topics/java.md>), [SIEM, Security, Observability](<https://devfeed.tech/topics/siem-security-observability.md>)

Tags: [guides](<https://devfeed.tech/tags/guides.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [logging](<https://devfeed.tech/tags/logging.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [tool](<https://devfeed.tech/tags/tool.md>), [traces](<https://devfeed.tech/tags/traces.md>)

### AI overview

This tutorial introduces JDK Flight Recorder as a production-capable JVM profiler and explains how it records JVM events. It also discusses JDK Mission Control for analyzing those events, runtime recordings, JFR commands, recording limits, and XML-based configurations.

### Source excerpt

JDK Flight Recorder, the profiler you can use in production, continuously. Flight Recorder has been available before in the JDK, e.g. it shipped as part of the JDK 8, but to use it, it demanded a to set specific commercial VM flags to unlock FlightRecorder, this is not anymore necessary with Java 11.

## Monitoring REST APIs with Custom JDK Flight Recorder Events

DevFeed: [Monitoring REST APIs with Custom JDK Flight Recorder Events](<https://devfeed.tech/articles/monitoring-rest-apis-with-custom-jdk-flight-recorder-events-18864.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/rest-api-monitoring-with-custom-jdk-flight-recorder-events/>)

Published: 2020-01-29T14:30:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [JDK Flight Recorder](<https://devfeed.tech/topics/jdk-flight-recorder.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Java](<https://devfeed.tech/topics/java.md>), [Grafana](<https://devfeed.tech/topics/grafana.md>), [Prometheus](<https://devfeed.tech/topics/prometheus.md>)

Tags: [grafana](<https://devfeed.tech/tags/grafana.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk-flight-recorder](<https://devfeed.tech/tags/jdk-flight-recorder.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [prometheus](<https://devfeed.tech/tags/prometheus.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rest-apis](<https://devfeed.tech/tags/rest-apis.md>)

### AI overview

This tutorial explains how custom JDK Flight Recorder events can monitor a REST API, including tracking request counts and identifying long-running requests. It also describes using the JFR Event Streaming API to export live events for monitoring and alerting with Prometheus and Grafana.

### Source excerpt

Table of Contents Custom Flight Recorder Events Creating JFR Recordings Event Settings JFR Event Streaming MicroProfile Metrics Summary and Related Work The JDK Flight Recorder (JFR) is an invaluable tool for gaining deep insights into the performance characteristics of Java applications. Open-sourced in JDK 11, JFR provides a low-overhead framework for collecting events from Java applications, the JVM and the operating system. In this blog post we're going to explore how custom, application-specific JFR events can be used to monitor a REST API, allowing to track request counts, identify long-running requests and more. We'll also discuss how the JFR Event Streaming API new in Java 14 can be used to export live events, making them available for monitoring and alerting via tools such as Prometheus and Grafana.