RFR: 8373096: JFR: Path-to-gc-roots search should be non-recursive [v3]
Erik Gahlin
egahlin at openjdk.org
Thu Jan 29 12:05:28 UTC 2026
On Thu, 29 Jan 2026 11:00:49 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRootsDFSBase.java line 67:
>>
>>> 65: File recording = new File(jfrFileName + r.getId() + ".jfr");
>>> 66: recording.delete();
>>> 67: JcmdHelper.jcmd("JFR.dump", "name=dodo", pathToGcRoots, "filename=" + recording.getAbsolutePath());
>>
>> Why do we need to do this using jcmd?
>
> Hmm, I just followed the same approach as `TestJcmdDumpPathToGCRoots`. I guess the alternative would be to start a child process JVM with -XX:StartFlightRecording dumponexit=true?
This is how I would implement it:
[patch.txt](https://github.com/user-attachments/files/24935579/patch.txt)
- Put all relevant information in the test file so that, when it fails, it can be easily analyzed without having to flip back and forth between a base class during triage, for example.
- Dump data programmatically, as it is quicker and easier to understand.
- Use the Events class to dump and extract and recording data.
- Place helper methods in the OldObjects class for reuse.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29382#discussion_r2741301803
More information about the hotspot-dev
mailing list