---
title: "JFR and Equality: A tale of many objects - Mostly nerdless"
url: https://daily.dev/posts/jfr-and-equality-a-tale-of-many-objects---mostly-nerdless-iwejgvkdu
source_url: https://mostlynerdless.de/blog/2025/10/10/jfr-and-equality-a-tale-of-many-objects/
type: article
source: "Mostly Nerdless"
published: 2026-03-16T08:15:24.345Z
updated: 2026-03-16T08:30:50.214Z
tags: ["java"]
reading_time: 8
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JFR and Equality: A tale of many objects - Mostly nerdless

**[Mostly Nerdless](https://daily.dev/sources/mostly-nerdless)** · 8 min read · 0 upvotes · 0 comments

## Summary

When analyzing JFR recordings via the Java API, comparing RecordedFrame objects using HashSet or equals/hashCode doesn't work as expected. Frames are inlined structs (each a distinct object), while methods are stored as shared references, so RecordedMethod equality works but RecordedFrame equality doesn't. Since RecordedObject doesn't implement hashCode/equals, object identity is used by default. The workaround is a wrapper record that accesses the internal 'objects' field via reflection (requiring --add-opens jdk.jfr/jdk.jfr.consumer=ALL-UNNAMED) to implement content-based equality. The post also covers safepoint bias in OpenJDK profilers and how DebugNonSafepoints can improve line-number accuracy.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://mostlynerdless.de/blog/2025/10/10/jfr-and-equality-a-tale-of-many-objects/>

## Similar posts on daily.dev

- [Unbiased Java CPU profiling with JFR in JDK 25](https://daily.dev/posts/unbiased-java-cpu-profiling-with-jfr-in-jdk-25-q2jelifnz) · Datadog · 3 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java)

[View this post on daily.dev](https://daily.dev/posts/jfr-and-equality-a-tale-of-many-objects---mostly-nerdless-iwejgvkdu)
