APIdia Launch Partner
Top Description Fields Constructors Methods
sun.management

public Class ThreadImpl

extends Object
implements ThreadMXBean
Class Inheritance
All Implemented Interfaces
java.lang.management.ThreadMXBean, java.lang.management.PlatformManagedObject
Imports
java.lang.management.ManagementFactory, .ThreadInfo, .ThreadMXBean, java.util.stream.Stream, javax.management.ObjectName, java.util.Arrays, .Objects

Implementation for java.lang.management.ThreadMXBean as well as providing the supporting method for com.sun.management.ThreadMXBean. The supporting method for com.sun.management.ThreadMXBean can be moved to jdk.management in the future.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private boolean
private final VMManagement

Constructor Summary

AccessConstructor and Description
protected
ThreadImpl(VMManagement vm)

Constructor of ThreadImpl class.

Method Summary

Modifier and TypeMethod and Description
public ThreadInfo[]
dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers)

Implements java.lang.management.ThreadMXBean.dumpAllThreads.

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.lang.management.ThreadMXBean.dumpAllThreads.

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[]
dumpThreads0(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)

private void
public long[]
findDeadlockedThreads()

Implements java.lang.management.ThreadMXBean.findDeadlockedThreads.

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.lang.management.ThreadMXBean.findMonitorDeadlockedThreads.

Finds cycles of platform threads that are in deadlock waiting to acquire object monitors.

private static native Thread[]
public long[]
getAllThreadIds()

Implements java.lang.management.ThreadMXBean.getAllThreadIds.

Returns the threadIDs of all live platform threads.

protected long
public long
getCurrentThreadCpuTime()

Implements java.lang.management.ThreadMXBean.getCurrentThreadCpuTime.

Returns the total CPU time for the current thread in nanoseconds.

public long
getCurrentThreadUserTime()

Implements java.lang.management.ThreadMXBean.getCurrentThreadUserTime.

Returns the CPU time that the current thread has executed in user mode in nanoseconds.

public int
getDaemonThreadCount()

Implements java.lang.management.ThreadMXBean.getDaemonThreadCount.

Returns the current number of live platform threads that are daemon threads.

public ObjectName
getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

public int
getPeakThreadCount()

Implements java.lang.management.ThreadMXBean.getPeakThreadCount.

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
getThreadAllocatedMemory1(long[] ids, long[] result)

public int
getThreadCount()

Implements java.lang.management.ThreadMXBean.getThreadCount.

Returns the current number of live platform threads including both daemon and non-daemon threads.

public long
getThreadCpuTime(long id)

Implements java.lang.management.ThreadMXBean.getThreadCpuTime.

Returns the total CPU time for a thread of the specified ID in nanoseconds.

protected long[]
getThreadCpuTime(long[] ids)

public ThreadInfo
getThreadInfo(long id)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for a thread of the specified id with no stack trace.

public ThreadInfo
getThreadInfo(long id, int maxDepth)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Returns a thread info for a thread of the specified id, with stack trace of a specified number of stack trace elements.

public ThreadInfo[]
getThreadInfo(long[] ids)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids with no stack trace.

public ThreadInfo[]
getThreadInfo(long[] ids, int maxDepth)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids, with stack trace of a specified number of stack trace elements.

public ThreadInfo[]
getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids, with stack trace and synchronization information.

public ThreadInfo[]
getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)

Overrides default java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids, with stack trace of the specified maximum number of elements and synchronization information.

private static native void
getThreadInfo1(long[] ids, int maxDepth, ThreadInfo[] result)

private static native Thread[]
private static native long
private static native void
getThreadTotalCpuTime1(long[] ids, long[] result)

private static native long
private static native void
getThreadUserCpuTime1(long[] ids, long[] result)

public long
getThreadUserTime(long id)

Implements java.lang.management.ThreadMXBean.getThreadUserTime.

Returns the CPU time that a thread of the specified ID has executed in user mode in nanoseconds.

protected long[]
getThreadUserTime(long[] ids)

public long
getTotalStartedThreadCount()

Implements java.lang.management.ThreadMXBean.getTotalStartedThreadCount.

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.lang.management.ThreadMXBean.isCurrentThreadCpuTimeSupported.

Tests if the Java virtual machine supports CPU time measurement from a platform thread with the getCurrentThreadCpuTime() and getCurrentThreadUserTime() methods.

public boolean
isObjectMonitorUsageSupported()

Implements java.lang.management.ThreadMXBean.isObjectMonitorUsageSupported.

Tests if the Java virtual machine supports monitoring of object monitor usage.

public boolean
isSynchronizerUsageSupported()

Implements java.lang.management.ThreadMXBean.isSynchronizerUsageSupported.

Tests if the Java virtual machine supports monitoring of ownable synchronizer usage.

protected boolean
protected boolean
public synchronized boolean
public boolean
isThreadContentionMonitoringSupported()

Implements java.lang.management.ThreadMXBean.isThreadContentionMonitoringSupported.

Tests if the Java virtual machine supports thread contention monitoring.

public boolean
isThreadCpuTimeEnabled()

Implements java.lang.management.ThreadMXBean.isThreadCpuTimeEnabled.

Tests if thread CPU time measurement is enabled.

public boolean
isThreadCpuTimeSupported()

Implements java.lang.management.ThreadMXBean.isThreadCpuTimeSupported.

Tests if the Java virtual machine implementation supports CPU time measurement for any platform thread.

private static native void
public void
resetPeakThreadCount()

Implements java.lang.management.ThreadMXBean.resetPeakThreadCount.

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.lang.management.ThreadMXBean.setThreadContentionMonitoringEnabled.

Enables or disables thread contention monitoring.

private static native void
public void
setThreadCpuTimeEnabled(boolean enable)

Implements java.lang.management.ThreadMXBean.setThreadCpuTimeEnabled.

Enables or disables thread CPU time measurement.

private static native void
setThreadCpuTimeEnabled0(boolean enable)

private static long[]
threadIds(Thread[] threads)

Returns the thread identifiers of the threads in the given array.

private long[]
threadsToIds(Thread[] threads)

Returns an array of thread identifiers for the threads in the given array.

private boolean
private void
verifyDumpThreads(boolean lockedMonitors, boolean lockedSynchronizers)

private boolean
private boolean
private boolean
verifyThreadCpuTime(long[] ids)

private void
verifyThreadId(long id)

private void
verifyThreadIds(long[] ids)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allocatedMemoryEnabledback to summary
private boolean allocatedMemoryEnabled
contentionMonitoringEnabledback to summary
private boolean contentionMonitoringEnabled
cpuTimeEnabledback to summary
private boolean cpuTimeEnabled
jvmback to summary
private final VMManagement jvm

Constructor Detail

ThreadImplback to summary
protected ThreadImpl(VMManagement vm)

Constructor of ThreadImpl class.

Method Detail

dumpAllThreadsback to summary
public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers)

Implements java.lang.management.ThreadMXBean.dumpAllThreads.

Doc from java.lang.management.ThreadMXBean.dumpAllThreads.

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(lockedMonitors, lockedSynchronizers, Integer.MAX_VALUE)
Annotations
@Override
dumpAllThreadsback to summary
public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)

Overrides default java.lang.management.ThreadMXBean.dumpAllThreads.

Doc from java.lang.management.ThreadMXBean.dumpAllThreads.

Returns the thread info for all live platform threads with stack trace of the specified maximum number of elements and synchronization information. if maxDepth == 0, no stack trace of the thread will be dumped. The thread IDs of virtual threads are not included. Some threads included in the returned array may have been terminated when this method returns.

This method returns an array of ThreadInfo objects as specified in the getThreadInfo(long[], boolean, boolean, int) method.

Annotations
@Override
dumpThreads0back to summary
private static native ThreadInfo[] dumpThreads0(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)
ensureThreadAllocatedMemorySupportedback to summary
private void ensureThreadAllocatedMemorySupported()
findDeadlockedThreadsback to summary
public long[] findDeadlockedThreads()

Implements java.lang.management.ThreadMXBean.findDeadlockedThreads.

Doc from java.lang.management.ThreadMXBean.findDeadlockedThreads.

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.

Annotations
@Override
findDeadlockedThreads0back to summary
private static native Thread[] findDeadlockedThreads0()
findMonitorDeadlockedThreadsback to summary
public long[] findMonitorDeadlockedThreads()

Implements java.lang.management.ThreadMXBean.findMonitorDeadlockedThreads.

Doc from java.lang.management.ThreadMXBean.findMonitorDeadlockedThreads.

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 Object.wait call, where each platform thread owns one monitor while trying to obtain another monitor already held by another platform thread in a cycle. Cycles that include virtual threads are not found by this method.

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 findDeadlockedThreads method should be used.

Annotations
@Override
findMonitorDeadlockedThreads0back to summary
private static native Thread[] findMonitorDeadlockedThreads0()
getAllThreadIdsback to summary
public long[] getAllThreadIds()

Implements java.lang.management.ThreadMXBean.getAllThreadIds.

Doc from java.lang.management.ThreadMXBean.getAllThreadIds.

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.

Annotations
@Override
getCurrentThreadAllocatedBytesback to summary
protected long getCurrentThreadAllocatedBytes()
getCurrentThreadCpuTimeback to summary
public long getCurrentThreadCpuTime()

Implements java.lang.management.ThreadMXBean.getCurrentThreadCpuTime.

Doc from java.lang.management.ThreadMXBean.getCurrentThreadCpuTime.

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:

  getThreadCpuTime(Thread.currentThread().threadId());
Annotations
@Override
getCurrentThreadUserTimeback to summary
public long getCurrentThreadUserTime()

Implements java.lang.management.ThreadMXBean.getCurrentThreadUserTime.

Doc from java.lang.management.ThreadMXBean.getCurrentThreadUserTime.

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:

  getThreadUserTime(Thread.currentThread().threadId());
Annotations
@Override
getDaemonThreadCountback to summary
public int getDaemonThreadCount()

Implements java.lang.management.ThreadMXBean.getDaemonThreadCount.

Doc from java.lang.management.ThreadMXBean.getDaemonThreadCount.

Returns the current number of live platform threads that are daemon threads. The count does not include virtual threads.

Annotations
@Override
getObjectNameback to summary
public ObjectName getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Doc from java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

Annotations
@Override
getPeakThreadCountback to summary
public int getPeakThreadCount()

Implements java.lang.management.ThreadMXBean.getPeakThreadCount.

Doc from java.lang.management.ThreadMXBean.getPeakThreadCount.

Returns the peak live platform thread count since the Java virtual machine started or peak was reset. The count does not include virtual threads.

Annotations
@Override
getThreadAllocatedBytesback to summary
protected long getThreadAllocatedBytes(long id)
getThreadAllocatedBytesback to summary
protected long[] getThreadAllocatedBytes(long[] ids)
getThreadAllocatedMemory0back to summary
private static native long getThreadAllocatedMemory0(long id)
getThreadAllocatedMemory1back to summary
private static native void getThreadAllocatedMemory1(long[] ids, long[] result)
getThreadCountback to summary
public int getThreadCount()

Implements java.lang.management.ThreadMXBean.getThreadCount.

Doc from java.lang.management.ThreadMXBean.getThreadCount.

Returns the current number of live platform threads including both daemon and non-daemon threads. The count does not include virtual threads.

Annotations
@Override
getThreadCpuTimeback to summary
public long getThreadCpuTime(long id)

Implements java.lang.management.ThreadMXBean.getThreadCpuTime.

Doc from java.lang.management.ThreadMXBean.getThreadCpuTime.

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 -1. If CPU time measurement is disabled, this method returns -1. A thread is alive if it has been started and has not yet terminated.

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.

Annotations
@Override
getThreadCpuTimeback to summary
protected long[] getThreadCpuTime(long[] ids)
getThreadInfoback to summary
public ThreadInfo getThreadInfo(long id)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Doc from java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for a thread of the specified id with no stack trace. This method is equivalent to calling:

getThreadInfo(id, 0);

This method returns a ThreadInfo object representing the thread information for the thread of the specified ID. The stack trace, locked monitors, and locked synchronizers in the returned ThreadInfo object will be empty. If a thread of the given ID is a virtual thread, is not alive, or does not exist, then this method will return null. A thread is alive if it has been started and has not yet terminated.

MBeanServer access:
The mapped type of ThreadInfo is CompositeData with attributes as specified in the ThreadInfo.from method.

Annotations
@Override
getThreadInfoback to summary
public ThreadInfo getThreadInfo(long id, int maxDepth)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Doc from java.lang.management.ThreadMXBean.getThreadInfo.

Returns a thread info for a thread of the specified id, with stack trace of a specified number of stack trace elements. The maxDepth parameter indicates the maximum number of StackTraceElement to be retrieved from the stack trace. If maxDepth == Integer.MAX_VALUE, the entire stack trace of the thread will be dumped. If maxDepth == 0, no stack trace of the thread will be dumped. This method does not obtain the locked monitors and locked synchronizers of the thread.

When the Java virtual machine has no stack trace information about a thread or maxDepth == 0, the stack trace in the ThreadInfo object will be an empty array of StackTraceElement.

If a thread of the given ID is a virtual thread, is not alive, or does not exist, this method will return null. A thread is alive if it has been started and has not yet terminated.

MBeanServer access:
The mapped type of ThreadInfo is CompositeData with attributes as specified in the ThreadInfo.from method.

Annotations
@Override
getThreadInfoback to summary
public ThreadInfo[] getThreadInfo(long[] ids)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Doc from java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids with no stack trace. This method is equivalent to calling:

  getThreadInfo(ids, 0);

This method returns an array of the ThreadInfo objects. The stack trace, locked monitors, and locked synchronizers in each ThreadInfo object will be empty. If a thread of the given ID is a virtual thread, is not alive, or does not exist, the corresponding element in the returned array will contain null. A thread is alive if it has been started and has not yet terminated.

MBeanServer access:
The mapped type of ThreadInfo is CompositeData with attributes as specified in the ThreadInfo.from method.

Annotations
@Override
getThreadInfoback to summary
public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Doc from java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids, with stack trace of a specified number of stack trace elements. The maxDepth parameter indicates the maximum number of StackTraceElement to be retrieved from the stack trace. If maxDepth == Integer.MAX_VALUE, the entire stack trace of the thread will be dumped. If maxDepth == 0, no stack trace of the thread will be dumped. This method does not obtain the locked monitors and locked synchronizers of the threads.

When the Java virtual machine has no stack trace information about a thread or maxDepth == 0, the stack trace in the ThreadInfo object will be an empty array of StackTraceElement.

This method returns an array of the ThreadInfo objects, each is the thread information about the thread with the same index as in the ids array. If a thread of the given ID is a virtual thread, is not alive, or does not exist, null will be set in the corresponding element in the returned array. A thread is alive if it has been started and has not yet terminated.

MBeanServer access:
The mapped type of ThreadInfo is CompositeData with attributes as specified in the ThreadInfo.from method.

Annotations
@Override
getThreadInfoback to summary
public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers)

Implements java.lang.management.ThreadMXBean.getThreadInfo.

Doc from java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids, with stack trace and synchronization information. This is equivalent to calling:

getThreadInfo(ids, lockedMonitors, lockedSynchronizers, Integer.MAX_VALUE)
Annotations
@Override
getThreadInfoback to summary
public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)

Overrides default java.lang.management.ThreadMXBean.getThreadInfo.

Doc from java.lang.management.ThreadMXBean.getThreadInfo.

Returns the thread info for each thread whose ID is in the input array ids, with stack trace of the specified maximum number of elements and synchronization information. If maxDepth == 0, no stack trace of the thread will be dumped.

This method obtains a snapshot of the thread information for each thread including:

  • stack trace of the specified maximum number of elements,
  • the object monitors currently locked by the thread if lockedMonitors is true, and
  • the ownable synchronizers currently locked by the thread if lockedSynchronizers is true.

This method returns an array of the ThreadInfo objects, each is the thread information about the thread with the same index as in the ids array. If a thread of the given ID is a virtual thread, is not alive, or does not exist, null will be set in the corresponding element in the returned array. A thread is alive if it has been started and has not yet terminated.

If a thread does not lock any object monitor or lockedMonitors is false, the returned ThreadInfo object will have an empty MonitorInfo array. Similarly, if a thread does not lock any synchronizer or lockedSynchronizers is false, the returned ThreadInfo object will have an empty LockInfo array.

When both lockedMonitors and lockedSynchronizers parameters are false, it is equivalent to calling:

    getThreadInfo(ids, maxDepth)

This method is designed for troubleshooting use, but not for synchronization control. It might be an expensive operation.

MBeanServer access:
The mapped type of ThreadInfo is CompositeData with attributes as specified in the ThreadInfo.from method.

Annotations
@Override
getThreadInfo1back to summary
private static native void getThreadInfo1(long[] ids, int maxDepth, ThreadInfo[] result)
getThreadsback to summary
private static native Thread[] getThreads()
getThreadTotalCpuTime0back to summary
private static native long getThreadTotalCpuTime0(long id)
getThreadTotalCpuTime1back to summary
private static native void getThreadTotalCpuTime1(long[] ids, long[] result)
getThreadUserCpuTime0back to summary
private static native long getThreadUserCpuTime0(long id)
getThreadUserCpuTime1back to summary
private static native void getThreadUserCpuTime1(long[] ids, long[] result)
getThreadUserTimeback to summary
public long getThreadUserTime(long id)

Implements java.lang.management.ThreadMXBean.getThreadUserTime.

Doc from java.lang.management.ThreadMXBean.getThreadUserTime.

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 -1. If CPU time measurement is disabled, this method returns -1. A thread is alive if it has been started and has not yet terminated.

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.

Annotations
@Override
getThreadUserTimeback to summary
protected long[] getThreadUserTime(long[] ids)
getTotalStartedThreadCountback to summary
public long getTotalStartedThreadCount()

Implements java.lang.management.ThreadMXBean.getTotalStartedThreadCount.

Doc from java.lang.management.ThreadMXBean.getTotalStartedThreadCount.

Returns the total number of platform threads created and also started since the Java virtual machine started. The count does not include virtual threads.

Annotations
@Override
getTotalThreadAllocatedBytesback to summary
protected long getTotalThreadAllocatedBytes()
getTotalThreadAllocatedMemoryback to summary
private static native long getTotalThreadAllocatedMemory()
isCurrentThreadCpuTimeSupportedback to summary
public boolean isCurrentThreadCpuTimeSupported()

Implements java.lang.management.ThreadMXBean.isCurrentThreadCpuTimeSupported.

Doc from java.lang.management.ThreadMXBean.isCurrentThreadCpuTimeSupported.

Tests if the Java virtual machine supports CPU time measurement from a platform thread with the getCurrentThreadCpuTime() and getCurrentThreadUserTime() methods. This method returns true if isThreadCpuTimeSupported returns true.

Annotations
@Override
isObjectMonitorUsageSupportedback to summary
public boolean isObjectMonitorUsageSupported()

Implements java.lang.management.ThreadMXBean.isObjectMonitorUsageSupported.

Doc from java.lang.management.ThreadMXBean.isObjectMonitorUsageSupported.

Tests if the Java virtual machine supports monitoring of object monitor usage.

Annotations
@Override
isSynchronizerUsageSupportedback to summary
public boolean isSynchronizerUsageSupported()

Implements java.lang.management.ThreadMXBean.isSynchronizerUsageSupported.

Doc from java.lang.management.ThreadMXBean.isSynchronizerUsageSupported.

Tests if the Java virtual machine supports monitoring of ownable synchronizer usage.

Annotations
@Override
isThreadAllocatedMemoryEnabledback to summary
protected boolean isThreadAllocatedMemoryEnabled()
isThreadAllocatedMemorySupportedback to summary
protected boolean isThreadAllocatedMemorySupported()
isThreadContentionMonitoringEnabledback to summary
public synchronized boolean isThreadContentionMonitoringEnabled()

Implements java.lang.management.ThreadMXBean.isThreadContentionMonitoringEnabled.

Doc from java.lang.management.ThreadMXBean.isThreadContentionMonitoringEnabled.

Tests if thread contention monitoring is enabled.

Annotations
@Override
isThreadContentionMonitoringSupportedback to summary
public boolean isThreadContentionMonitoringSupported()

Implements java.lang.management.ThreadMXBean.isThreadContentionMonitoringSupported.

Doc from java.lang.management.ThreadMXBean.isThreadContentionMonitoringSupported.

Tests if the Java virtual machine supports thread contention monitoring.

Annotations
@Override
isThreadCpuTimeEnabledback to summary
public boolean isThreadCpuTimeEnabled()

Implements java.lang.management.ThreadMXBean.isThreadCpuTimeEnabled.

Doc from java.lang.management.ThreadMXBean.isThreadCpuTimeEnabled.

Tests if thread CPU time measurement is enabled.

Annotations
@Override
isThreadCpuTimeSupportedback to summary
public boolean isThreadCpuTimeSupported()

Implements java.lang.management.ThreadMXBean.isThreadCpuTimeSupported.

Doc from java.lang.management.ThreadMXBean.isThreadCpuTimeSupported.

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.

Annotations
@Override
resetContentionTimes0back to summary
private static native void resetContentionTimes0(long tid)
resetPeakThreadCountback to summary
public void resetPeakThreadCount()

Implements java.lang.management.ThreadMXBean.resetPeakThreadCount.

Doc from java.lang.management.ThreadMXBean.resetPeakThreadCount.

Resets the peak thread count to the current number of live platform threads.

Annotations
@Override
resetPeakThreadCount0back to summary
private static native void resetPeakThreadCount0()
setThreadAllocatedMemoryEnabledback to summary
protected void setThreadAllocatedMemoryEnabled(boolean enable)
setThreadAllocatedMemoryEnabled0back to summary
private static native void setThreadAllocatedMemoryEnabled0(boolean enable)
setThreadContentionMonitoringEnabledback to summary
public void setThreadContentionMonitoringEnabled(boolean enable)

Implements java.lang.management.ThreadMXBean.setThreadContentionMonitoringEnabled.

Doc from java.lang.management.ThreadMXBean.setThreadContentionMonitoringEnabled.

Enables or disables thread contention monitoring. Thread contention monitoring is disabled by default.

Annotations
@Override
setThreadContentionMonitoringEnabled0back to summary
private static native void setThreadContentionMonitoringEnabled0(boolean enable)
setThreadCpuTimeEnabledback to summary
public void setThreadCpuTimeEnabled(boolean enable)

Implements java.lang.management.ThreadMXBean.setThreadCpuTimeEnabled.

Doc from java.lang.management.ThreadMXBean.setThreadCpuTimeEnabled.

Enables or disables thread CPU time measurement. The default is platform dependent.

Annotations
@Override
setThreadCpuTimeEnabled0back to summary
private static native void setThreadCpuTimeEnabled0(boolean enable)
threadIdsback to summary
private static long[] threadIds(Thread[] threads)

Returns the thread identifiers of the threads in the given array.

threadsToIdsback to summary
private long[] threadsToIds(Thread[] threads)

Returns an array of thread identifiers for the threads in the given array. Returns null if threads is null or the array of threads is empty.

verifyCurrentThreadCpuTimeback to summary
private boolean verifyCurrentThreadCpuTime()
verifyDumpThreadsback to summary
private void verifyDumpThreads(boolean lockedMonitors, boolean lockedSynchronizers)
verifyThreadAllocatedMemoryback to summary
private boolean verifyThreadAllocatedMemory(long id)
verifyThreadAllocatedMemoryback to summary
private boolean verifyThreadAllocatedMemory(long[] ids)
verifyThreadCpuTimeback to summary
private boolean verifyThreadCpuTime(long[] ids)
verifyThreadIdback to summary
private void verifyThreadId(long id)
verifyThreadIdsback to summary
private void verifyThreadIds(long[] ids)