diff --git a/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java index 8ce7c03f62d..9ed1069155b 100644 --- a/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java +++ b/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,11 +117,8 @@ public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { * does not exist. * *

When the format is specified as {@link ThreadDumpFormat#JSON JSON}, the - * thread dump is generated in JavaScript Object Notation. - * threadDump.schema.json - * describes the thread dump format in draft - * - * JSON Schema Language version 2. + * thread dump is generated as JSON text in the + * JSON Thread Dump Format. * *

The thread dump will include output for all platform threads. It may * include output for some or all virtual threads. diff --git a/src/jdk.management/share/classes/com/sun/management/doc-files/threadDump.html b/src/jdk.management/share/classes/com/sun/management/doc-files/threadDump.html new file mode 100644 index 00000000000..f7dd84d4f32 --- /dev/null +++ b/src/jdk.management/share/classes/com/sun/management/doc-files/threadDump.html @@ -0,0 +1,283 @@ + + + + + JSON Thread Dump Format + + + +

JSON Thread Dump Format

+ +The JSON text is an object with a member named "threadDump" that is an object with the +following members: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
threadDump members
NameData typeOptionalDescription
formatVersion number no The format version. Its value is 2.
processId number no The process identifier (pid) of the VM that generated the thread dump.
time string no The timestamp, in ISO 8601 format, when the thread dump was generated.
runtimeVersion string no The {@linkplain java.lang.Runtime.Version runtime version} of the VM that + generated the thread dump.
threadContainers array no The array of thread "groupings". The first element is the root grouping/container + with name "<root>".
+ +

Each element in the "threadContainers" array is an object that represents a + grouping/container of threads with the following members: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
threadContainers members
NameData typeOptionalDescription
container string no The thread container name. The name is unique.
parent string or null no The thread container parent's name or {@code null} for the root container.
owner number or null no The {@linkplain java.lang.Thread#threadId() thread identifier} of the thread + that owns the thread container or {@code null} if no owner.
threads array no The array of threads in the thread grouping/container.
threadCount number yes The number of threads in the thread grouping/container. If the thread dump + includes all virtual threads then this count is the same as the number of + elements in the threads array. If all virtual threads are not included then + it may be larger than the number of elements in the threads array.
+ +

Each element in a "threads" array is an object with the following members: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
threads members
NameData typeOptionalDescription
tid number no The {@linkplain java.lang.Thread#threadId() thread identifier}.
time string no The timestamp, in ISO 8601 format, when the thread was sampled.
name string no The {@linkplain java.lang.Thread#getName() thread name}.
state string no The string representation of the {@linkplain java.lang.Thread#getState() thread state}.
virtual boolean yes {@code true} if the thread is a {@linkplain java.lang.Thread#isVirtual() virtual thread}.
carrier number yes The thread identifier of the carrier thread when this thread is a mounted + virtual thread.
stack array no The thread stack. The elements in the array are of type string with the string + representation of a {@linkplain java.lang.StackTraceElement stack trace element}. + If the thread stack has one or more elements, then the first element is the top + of the stack.
parkBlocker object yes The object responsible for the thread parking. Its members identify the + blocker object, and the exclusive owner thread if owned.
blockedOn string yes The {@linkplain java.util.Objects#toIdentityString(Object) identity string} of the + object that the thread is blocked on waiting to enter/re-enter a synchronization + method or block.
waitingOn string yes The {@linkplain java.util.Objects#toIdentityString(Object) identity string} + of the object that the thread is {@linkplain java.lang.Object#wait() waiting} + to be notified.
monitorsOwned array yes The objects for which a monitor is owned by the thread.
+ +

A "parkBlocker" object has the following members: + + + + + + + + + + + + + + + + + + + + + + + + +
parkBlocker members
NameData typeOptionalDescription
object string no The {@linkplain java.util.Objects#toIdentityString(Object) identity string} + of the {@linkplain java.util.concurrent.locks.LockSupport#park(Object) blocker + object} responsible for the thread parking.
owner number yes The thread identifier of the exclusive owner thread when the parkBlocker is + an {@link java.util.concurrent.locks.AbstractOwnableSynchronizer}.
+ +

Each element in a "monitorsOwned" array is an object with the following members:

+ + + + + + + + + + + + + + + + + + + + + + + + +
monitorsOwned members
NameData typeOptionalDescription
depth number no The stack depth at which the monitors are owned.
locks array no The elements of the array are of type string or null. An element of type string + has a value that is the {@linkplain java.util.Objects#toIdentityString(Object) + identity string} of the object for which the monitor is owned by the thread. + The element is of type null when the object has been eliminated.
+ + + diff --git a/src/jdk.management/share/classes/com/sun/management/doc-files/threadDump.schema.json b/src/jdk.management/share/classes/com/sun/management/doc-files/threadDump.schema.json deleted file mode 100644 index 30161b0bb74..00000000000 --- a/src/jdk.management/share/classes/com/sun/management/doc-files/threadDump.schema.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "type": "object", - "properties": { - "threadDump": { - "type": "object", - "properties": { - "formatVersion": { - "type": "integer", - "description": "Format version (2)." - }, - "processId": { - "type": "integer", - "description": "The native process id of the Java virtual machine." - }, - "time": { - "type": "string", - "description": "The time in ISO 8601 format when the thread dump was generated." - }, - "runtimeVersion": { - "type": "string", - "description": "The runtime version, see java.lang.Runtime.Version" - }, - "threadContainers": { - "type": "array", - "description": "The array of thread containers (thread groupings).", - "items": [ - { - "type": "object", - "properties": { - "container": { - "type": "string", - "description": "The container name. The container name is unique." - }, - "parent": { - "type": [ "string", "null" ], - "description": "The parent container name or null for the root container." - }, - "owner": { - "type": [ "integer", "null" ], - "description": "The thread identifier of the owner thread or null if no owner." - }, - "threads": { - "type": "array", - "description": "The array of threads in the thread container.", - "items": [ - { - "type": "object", - "properties": { - "tid": { - "type": "integer", - "description": "The thread identifier." - }, - "time": { - "type": "string", - "description": "The time in ISO 8601 format that the thread was sampled." - }, - "name": { - "type": "string", - "description": "The thread name." - }, - "state": { - "type": "string", - "description": "The thread state (Thread::getState)." - }, - "virtual" : { - "type": "boolean", - "description": "true for a virtual thread." - }, - "parkBlocker": { - "type": "object", - "properties": { - "object": { - "type": "string", - "description": "The blocker object responsible for the thread parking." - } - }, - "owner": { - "type": "integer", - "description": "The thread identifier of the owner when the parkBlocker is an AbstractOwnableSynchronizer." - }, - "required": [ - "object" - ] - }, - "blockedOn": { - "type": "string", - "description": "The object that the thread is blocked on waiting to enter/re-enter a synchronization block/method." - }, - "waitingOn": { - "type": "string", - "description": "The object that the thread is waiting to be notified (Object.wait)." - }, - "stack": { - "type": "array", - "description": "The thread stack. The first element is the top of the stack.", - "items": [ - { - "type": "string", - "description": "A stack trace element (java.lang.StackTraceElement)." - } - ] - }, - "monitorsOwned": { - "type": "array", - "description": "The objects for which monitors are owned by the thread.", - "items": { - "type": "object", - "properties": { - "depth": { - "type": "integer", - "description": "The stack depth at which the monitors are owned." - }, - "locks": { - "type": "array", - "items": { - "type": [ "string", "null" ], - "description": "The object for which the monitor is owned by the thread, null if eliminated." - } - } - }, - "required": [ - "depth", - "locks" - ] - } - }, - "carrier": { - "type": "integer", - "description": "The thread identifier of the carrier thread if mounted." - } - }, - "required": [ - "tid", - "time", - "name", - "state", - "stack" - ] - } - ] - }, - "threadCount": { - "type": "integer", - "description": "The number of threads in the thread container." - } - }, - "required": [ - "container", - "parent", - "owner", - "threads" - ] - } - ] - } - }, - "required": [ - "formatVersion", - "processId", - "time", - "runtimeVersion", - "threadContainers" - ] - } - }, - "required": [ - "threadDump" - ] -}