Quality Outreach Heads-up - JDK 27: Numeric Fields in JSON Thread Dumps

The OpenJDK Quality Group is promoting the testing of FOSS projects with OpenJDK builds as a way to improve the overall quality of the release. This heads-up is part of a Quality Outreach update sent to the projects involved. To learn more about the program and how to join, please check the Quality Outreach wiki page.

Numeric Values Usage in JSON Thread Dumps

JSON thread dumps generated by com.sun.management.HotSpotDiagnosticMXBean.dumpThreads and the jcmd Thread.dump_to_file command now write thread identifiers, thread counts, and the process identifier as JSON numbers instead of strings.

For example, when using a command like jcmd <PID> Thread.dump_to_file -format=json threads.json to write thread stack traces to a file in JSON format, the output would look like in the snippet below.

{
  "threadDump": {
    "formatVersion": 2,
    "processId": 36340,
    "time": "2026-05-15T12:43:21.601545Z",
    "runtimeVersion": "27-ea+22-2010",
    "threadContainers": [
      {
        "container": "<root>",
        "parent": null,
        "owner": null,
        "threads": [
          {
            "tid": 3,
            "time": "2026-05-15T12:43:21.604046Z",
            "name": "main",
            "state": "TIMED_WAITING",
            "stack": [
              "java.base\/java.lang.Thread.sleepNanos0(Native Method)",
              "java.base\/java.lang.Thread.sleepNanos(Thread.java:562)",
              "java.base\/java.lang.Thread.sleep(Thread.java:593)",
              "HelloThreads.main(HelloThreads.java:4)",
              "java.base\/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)",
              "java.base\/java.lang.reflect.Method.invoke(Method.java:583)",
              "jdk.compiler\/com.sun.tools.javac.launcher.SourceLauncher.execute(SourceLauncher.java:260)",
              "jdk.compiler\/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:138)",
              "jdk.compiler\/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:76)"
            ]
          }
        ],
        "threadCount": 7
      }
      ....
    ]
  }
}

This change of format also introduces versioning through "formatVersion": 2 member, while metadata fields such as processId, tid, and threadCount are serialized as JSON numeric values rather than JSON string types.

Call to Action

We encourage you to download the JDK 27 early-access builds and test any tools, scripts, tests, or applications that parse JSON thread dumps. If needed, update them to handle numeric values for thread identifiers, thread counts, and the process identifier, and use the new formatVersion field to detect and handle future thread dump format changes.

~