| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private boolean | |
| private final VMManagement |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public ThreadInfo[] | dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers)
Implements java. Returns the thread info for all live platform threads with stack trace and synchronization information. |
| public ThreadInfo[] | dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)
Overrides default java. Returns the thread info for all live platform threads with stack trace of the specified maximum number of elements and synchronization information. |
| private static native ThreadInfo[] | |
| private void | |
| public long[] | findDeadlockedThreads()
Implements java. Finds cycles of platform threads that are in deadlock waiting to acquire object monitors or ownable synchronizers. |
| private static native Thread[] | |
| public long[] | findMonitorDeadlockedThreads()
Implements java. Finds cycles of platform threads that are in deadlock waiting to acquire object monitors. |
| private static native Thread[] | |
| public long[] | getAllThreadIds()
Implements java. Returns the threadIDs of all live platform threads. |
| protected long | |
| public long | getCurrentThreadCpuTime()
Implements java. Returns the total CPU time for the current thread in nanoseconds. |
| public long | getCurrentThreadUserTime()
Implements java. Returns the CPU time that the current thread has executed in user mode in nanoseconds. |
| public int | getDaemonThreadCount()
Implements java. Returns the current number of live platform threads that are daemon threads. |
| public ObjectName | getObjectName()
Implements java. Returns an |
| public int | getPeakThreadCount()
Implements java. Returns the peak live platform thread count since the Java virtual machine started or peak was reset. |
| protected long | |
| protected long[] | |
| private static native long | |
| private static native void | |
| public int | getThreadCount()
Implements java. Returns the current number of live platform threads including both daemon and non-daemon threads. |
| public long | getThreadCpuTime(long id)
Implements java. Returns the total CPU time for a thread of the specified ID in nanoseconds. |
| protected long[] | |
| public ThreadInfo | getThreadInfo(long id)
Implements java. Returns the thread info for a thread of the specified
|
| public ThreadInfo | getThreadInfo(long id, int maxDepth)
Implements java. Returns a thread info for a thread of the specified |
| public ThreadInfo[] | getThreadInfo(long[] ids)
Implements java. Returns the thread info for each thread
whose ID is in the input array |
| public ThreadInfo[] | getThreadInfo(long[] ids, int maxDepth)
Implements java. Returns the thread info for each thread
whose ID is in the input array |
| public ThreadInfo[] | getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers)
Implements java. Returns the thread info for each thread
whose ID is in the input array |
| public ThreadInfo[] | getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)
Overrides default java. Returns the thread info for each thread whose ID
is in the input array |
| private static native void | |
| private static native Thread[] | |
| private static native long | |
| private static native void | |
| private static native long | |
| private static native void | |
| public long | getThreadUserTime(long id)
Implements java. Returns the CPU time that a thread of the specified ID has executed in user mode in nanoseconds. |
| protected long[] | |
| public long | getTotalStartedThreadCount()
Implements java. Returns the total number of platform threads created and also started since the Java virtual machine started. |
| protected long | |
| private static native long | |
| public boolean | isCurrentThreadCpuTimeSupported()
Implements java. Tests if the Java virtual machine supports CPU time measurement from
a platform thread with the |
| public boolean | isObjectMonitorUsageSupported()
Implements java. Tests if the Java virtual machine supports monitoring of object monitor usage. |
| public boolean | isSynchronizerUsageSupported()
Implements java. Tests if the Java virtual machine supports monitoring of ownable synchronizer usage. |
| protected boolean | |
| protected boolean | |
| public synchronized boolean | isThreadContentionMonitoringEnabled()
Implements java. Tests if thread contention monitoring is enabled. |
| public boolean | isThreadContentionMonitoringSupported()
Implements java. Tests if the Java virtual machine supports thread contention monitoring. |
| public boolean | isThreadCpuTimeEnabled()
Implements java. Tests if thread CPU time measurement is enabled. |
| public boolean | isThreadCpuTimeSupported()
Implements java. Tests if the Java virtual machine implementation supports CPU time measurement for any platform thread. |
| private static native void | |
| public void | resetPeakThreadCount()
Implements java. Resets the peak thread count to the current number of live platform threads. |
| private static native void | |
| protected void | |
| private static native void | |
| public void | setThreadContentionMonitoringEnabled(boolean enable)
Implements java. Enables or disables thread contention monitoring. |
| private static native void | |
| public void | setThreadCpuTimeEnabled(boolean enable)
Implements java. Enables or disables thread CPU time measurement. |
| private static native void | |
| private static long[] | |
| private long[] | threadsToIds(Thread[] threads)
Returns an array of thread identifiers for the threads in the given array. |
| private boolean | |
| private void | |
| private boolean | |
| private boolean | |
| private boolean | |
| private void | |
| private void |
| allocatedMemoryEnabled | back to summary |
|---|---|
| private boolean allocatedMemoryEnabled | |
| contentionMonitoringEnabled | back to summary |
|---|---|
| private boolean contentionMonitoringEnabled | |
| cpuTimeEnabled | back to summary |
|---|---|
| private boolean cpuTimeEnabled | |
| jvm | back to summary |
|---|---|
| private final VMManagement jvm | |
| ThreadImpl | back to summary |
|---|---|
| protected ThreadImpl(VMManagement vm) Constructor of ThreadImpl class. | |
| dumpAllThreads | back to summary |
|---|---|
| public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers) Implements java. Doc from java. Returns the thread info for all live platform threads with stack trace and synchronization information. The thread IDs of virtual threads are not included. This method is equivalent to calling:
| |
| dumpAllThreads | back to summary |
|---|---|
| public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) Overrides default java. Doc from java. Returns the thread info for all live platform threads
with stack trace of the specified maximum number of elements
and synchronization information.
if
This method returns an array of
| |
| dumpThreads0 | back to summary |
|---|---|
| private static native ThreadInfo[] dumpThreads0(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) | |
| ensureThreadAllocatedMemorySupported | back to summary |
|---|---|
| private void ensureThreadAllocatedMemorySupported() | |
| findDeadlockedThreads | back to summary |
|---|---|
| public long[] findDeadlockedThreads() Implements java. Doc from java. Finds cycles of platform threads that are in deadlock waiting to acquire object monitors or ownable synchronizers. Platform threads are deadlocked in a cycle waiting for a lock of these two types if each thread owns one lock while trying to acquire another lock already held by another platform thread in the cycle. Cycles that include virtual threads are not found by this method. This method is designed for troubleshooting use, but not for synchronization control. It might be an expensive operation.
| |
| findDeadlockedThreads0 | back to summary |
|---|---|
| private static native Thread[] findDeadlockedThreads0() | |
| findMonitorDeadlockedThreads | back to summary |
|---|---|
| public long[] findMonitorDeadlockedThreads() Implements java. Doc from java. Finds cycles of platform threads that are in deadlock waiting to acquire
object monitors. That is, platform threads that are blocked waiting to
enter a synchronization block or waiting to reenter a synchronization block
after an More formally, a thread is monitor deadlocked if it is part of a cycle in the relation "is waiting for an object monitor owned by". In the simplest case, thread A is blocked waiting for a monitor owned by thread B, and thread B is blocked waiting for a monitor owned by thread A. This method is designed for troubleshooting use, but not for synchronization control. It might be an expensive operation.
This method finds deadlocks involving only object monitors.
To find deadlocks involving both object monitors and
ownable synchronizers,
the
| |
| findMonitorDeadlockedThreads0 | back to summary |
|---|---|
| private static native Thread[] findMonitorDeadlockedThreads0() | |
| getAllThreadIds | back to summary |
|---|---|
| public long[] getAllThreadIds() Implements java. Doc from java. Returns the threadIDs of all live platform threads. The thread IDs of virtual threads are not included. Some threads included in the returned array may have been terminated when this method returns.
| |
| getCurrentThreadAllocatedBytes | back to summary |
|---|---|
| protected long getCurrentThreadAllocatedBytes() | |
| getCurrentThreadCpuTime | back to summary |
|---|---|
| public long getCurrentThreadCpuTime() Implements java. Doc from java. Returns the total CPU time for the current thread in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy. If the implementation distinguishes between user mode time and system mode time, the returned CPU time is the amount of time that the current thread has executed in user mode or system mode. This is a convenience method for local management use and is equivalent to calling:
| |
| getCurrentThreadUserTime | back to summary |
|---|---|
| public long getCurrentThreadUserTime() Implements java. Doc from java. Returns the CPU time that the current thread has executed in user mode in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy. This is a convenience method for local management use and is equivalent to calling:
| |
| getDaemonThreadCount | back to summary |
|---|---|
| public int getDaemonThreadCount() Implements java. Doc from java. Returns the current number of live platform threads that are daemon threads. The count does not include virtual threads.
| |
| getObjectName | back to summary |
|---|---|
| public ObjectName getObjectName() Implements java. Doc from java. Returns an
| |
| getPeakThreadCount | back to summary |
|---|---|
| public int getPeakThreadCount() Implements java. Doc from java. Returns the peak live platform thread count since the Java virtual machine started or peak was reset. The count does not include virtual threads.
| |
| getThreadAllocatedBytes | back to summary |
|---|---|
| protected long getThreadAllocatedBytes(long id) | |
| getThreadAllocatedBytes | back to summary |
|---|---|
| protected long[] getThreadAllocatedBytes(long[] ids) | |
| getThreadAllocatedMemory0 | back to summary |
|---|---|
| private static native long getThreadAllocatedMemory0(long id) | |
| getThreadAllocatedMemory1 | back to summary |
|---|---|
| private static native void getThreadAllocatedMemory1(long[] ids, long[] result) | |
| getThreadCount | back to summary |
|---|---|
| public int getThreadCount() Implements java. Doc from java. Returns the current number of live platform threads including both daemon and non-daemon threads. The count does not include virtual threads.
| |
| getThreadCpuTime | back to summary |
|---|---|
| public long getThreadCpuTime(long id) Implements java. Doc from java. Returns the total CPU time for a thread of the specified ID in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy. If the implementation distinguishes between user mode time and system mode time, the returned CPU time is the amount of time that the thread has executed in user mode or system mode.
If the thread of the specified ID is a virtual thread, is not alive or
does not exist, this method returns If CPU time measurement is enabled after the thread has started, the Java virtual machine implementation may choose any time up to and including the time that the capability is enabled as the point where CPU time measurement starts.
| |
| getThreadCpuTime | back to summary |
|---|---|
| protected long[] getThreadCpuTime(long[] ids) | |
| getThreadInfo | back to summary |
|---|---|
| public ThreadInfo getThreadInfo(long id) Implements java. Doc from java. Returns the thread info for a thread of the specified
This method returns a
MBeanServer access:
| |
| getThreadInfo | back to summary |
|---|---|
| public ThreadInfo getThreadInfo(long id, int maxDepth) Implements java. Doc from java. Returns a thread info for a thread of the specified
When the Java virtual machine has no stack trace information
about a thread or
If a thread of the given ID is a virtual thread, is not alive, or does
not exist, this method will return
MBeanServer access:
| |
| getThreadInfo | back to summary |
|---|---|
| public ThreadInfo[] getThreadInfo(long[] ids) Implements java. Doc from java. Returns the thread info for each thread
whose ID is in the input array
This method returns an array of the
MBeanServer access:
| |
| getThreadInfo | back to summary |
|---|---|
| public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth) Implements java. Doc from java. Returns the thread info for each thread
whose ID is in the input array
When the Java virtual machine has no stack trace information
about a thread or
This method returns an array of the
MBeanServer access:
| |
| getThreadInfo | back to summary |
|---|---|
| public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers) Implements java. Doc from java. Returns the thread info for each thread
whose ID is in the input array
| |
| getThreadInfo | back to summary |
|---|---|
| public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) Overrides default java. Doc from java. Returns the thread info for each thread whose ID
is in the input array This method obtains a snapshot of the thread information for each thread including:
This method returns an array of the
If a thread does not lock any object monitor or
When both
This method is designed for troubleshooting use, but not for synchronization control. It might be an expensive operation.
MBeanServer access:
| |
| getThreadInfo1 | back to summary |
|---|---|
| private static native void getThreadInfo1(long[] ids, int maxDepth, ThreadInfo[] result) | |
| getThreads | back to summary |
|---|---|
| private static native Thread[] getThreads() | |
| getThreadTotalCpuTime0 | back to summary |
|---|---|
| private static native long getThreadTotalCpuTime0(long id) | |
| getThreadTotalCpuTime1 | back to summary |
|---|---|
| private static native void getThreadTotalCpuTime1(long[] ids, long[] result) | |
| getThreadUserCpuTime0 | back to summary |
|---|---|
| private static native long getThreadUserCpuTime0(long id) | |
| getThreadUserCpuTime1 | back to summary |
|---|---|
| private static native void getThreadUserCpuTime1(long[] ids, long[] result) | |
| getThreadUserTime | back to summary |
|---|---|
| public long getThreadUserTime(long id) Implements java. Doc from java. Returns the CPU time that a thread of the specified ID has executed in user mode in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy.
If the thread of the specified ID is a virtual thread, is not alive, or
does not exist, this method returns If CPU time measurement is enabled after the thread has started, the Java virtual machine implementation may choose any time up to and including the time that the capability is enabled as the point where CPU time measurement starts.
| |
| getThreadUserTime | back to summary |
|---|---|
| protected long[] getThreadUserTime(long[] ids) | |
| getTotalStartedThreadCount | back to summary |
|---|---|
| public long getTotalStartedThreadCount() Implements java. Doc from java. Returns the total number of platform threads created and also started since the Java virtual machine started. The count does not include virtual threads.
| |
| getTotalThreadAllocatedBytes | back to summary |
|---|---|
| protected long getTotalThreadAllocatedBytes() | |
| getTotalThreadAllocatedMemory | back to summary |
|---|---|
| private static native long getTotalThreadAllocatedMemory() | |
| isCurrentThreadCpuTimeSupported | back to summary |
|---|---|
| public boolean isCurrentThreadCpuTimeSupported() Implements java. Doc from java. Tests if the Java virtual machine supports CPU time measurement from
a platform thread with the
| |
| isObjectMonitorUsageSupported | back to summary |
|---|---|
| public boolean isObjectMonitorUsageSupported() Implements java. Doc from java. Tests if the Java virtual machine supports monitoring of object monitor usage.
| |
| isSynchronizerUsageSupported | back to summary |
|---|---|
| public boolean isSynchronizerUsageSupported() Implements java. Doc from java. Tests if the Java virtual machine supports monitoring of ownable synchronizer usage.
| |
| isThreadAllocatedMemoryEnabled | back to summary |
|---|---|
| protected boolean isThreadAllocatedMemoryEnabled() | |
| isThreadAllocatedMemorySupported | back to summary |
|---|---|
| protected boolean isThreadAllocatedMemorySupported() | |
| isThreadContentionMonitoringEnabled | back to summary |
|---|---|
| public synchronized boolean isThreadContentionMonitoringEnabled() Implements java. Doc from java. Tests if thread contention monitoring is enabled.
| |
| isThreadContentionMonitoringSupported | back to summary |
|---|---|
| public boolean isThreadContentionMonitoringSupported() Implements java. Doc from java. Tests if the Java virtual machine supports thread contention monitoring.
| |
| isThreadCpuTimeEnabled | back to summary |
|---|---|
| public boolean isThreadCpuTimeEnabled() Implements java. Doc from java. Tests if thread CPU time measurement is enabled.
| |
| isThreadCpuTimeSupported | back to summary |
|---|---|
| public boolean isThreadCpuTimeSupported() Implements java. Doc from java. Tests if the Java virtual machine implementation supports CPU time measurement for any platform thread. A Java virtual machine implementation that supports CPU time measurement for any platform thread will also support CPU time measurement for the current thread, when the current thread is a platform thread.
| |
| resetContentionTimes0 | back to summary |
|---|---|
| private static native void resetContentionTimes0(long tid) | |
| resetPeakThreadCount | back to summary |
|---|---|
| public void resetPeakThreadCount() Implements java. Doc from java. Resets the peak thread count to the current number of live platform threads.
| |
| resetPeakThreadCount0 | back to summary |
|---|---|
| private static native void resetPeakThreadCount0() | |
| setThreadAllocatedMemoryEnabled | back to summary |
|---|---|
| protected void setThreadAllocatedMemoryEnabled(boolean enable) | |
| setThreadAllocatedMemoryEnabled0 | back to summary |
|---|---|
| private static native void setThreadAllocatedMemoryEnabled0(boolean enable) | |
| setThreadContentionMonitoringEnabled | back to summary |
|---|---|
| public void setThreadContentionMonitoringEnabled(boolean enable) Implements java. Doc from java. Enables or disables thread contention monitoring. Thread contention monitoring is disabled by default.
| |
| setThreadContentionMonitoringEnabled0 | back to summary |
|---|---|
| private static native void setThreadContentionMonitoringEnabled0(boolean enable) | |
| setThreadCpuTimeEnabled | back to summary |
|---|---|
| public void setThreadCpuTimeEnabled(boolean enable) Implements java. Doc from java. Enables or disables thread CPU time measurement. The default is platform dependent.
| |
| setThreadCpuTimeEnabled0 | back to summary |
|---|---|
| private static native void setThreadCpuTimeEnabled0(boolean enable) | |
| threadIds | back to summary |
|---|---|
| private static long[] threadIds(Thread[] threads) Returns the thread identifiers of the threads in the given array. | |
| threadsToIds | back to summary |
|---|---|
| private long[] threadsToIds(Thread[] threads) Returns an array of thread identifiers for the threads in the given
array. Returns | |
| verifyCurrentThreadCpuTime | back to summary |
|---|---|
| private boolean verifyCurrentThreadCpuTime() | |
| verifyDumpThreads | back to summary |
|---|---|
| private void verifyDumpThreads(boolean lockedMonitors, boolean lockedSynchronizers) | |
| verifyThreadAllocatedMemory | back to summary |
|---|---|
| private boolean verifyThreadAllocatedMemory(long id) | |
| verifyThreadAllocatedMemory | back to summary |
|---|---|
| private boolean verifyThreadAllocatedMemory(long[] ids) | |
| verifyThreadCpuTime | back to summary |
|---|---|
| private boolean verifyThreadCpuTime(long[] ids) | |
| verifyThreadId | back to summary |
|---|---|
| private void verifyThreadId(long id) | |
| verifyThreadIds | back to summary |
|---|---|
| private void verifyThreadIds(long[] ids) | |