Example usage for Java java.lang.management ThreadMXBean fields, constructors, methods, implement or subclass
The text is from its open source code.
ThreadInfo[] | dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers) Returns the thread info for all live threads with stack trace and synchronization information. |
long[] | findDeadlockedThreads() Finds cycles of threads that are in deadlock waiting to acquire object monitors or ownable synchronizers. |
long[] | findMonitorDeadlockedThreads() Finds cycles of threads that are in deadlock waiting to acquire object monitors. |
long[] | getAllThreadIds() Returns all live thread IDs. |
Class> | getClass() Returns the runtime class of this Object . |
long | getCurrentThreadCpuTime() Returns the total CPU time for the current thread in nanoseconds. |
long | getCurrentThreadUserTime() Returns the CPU time that the current thread has executed in user mode in nanoseconds. |
int | getDaemonThreadCount() Returns the current number of live daemon threads. |
int | getPeakThreadCount() Returns the peak live thread count since the Java virtual machine started or peak was reset. |
int | getThreadCount() Returns the current number of live threads including both daemon and non-daemon threads. |
long | getThreadCpuTime(long id) Returns the total CPU time for a thread of the specified ID in nanoseconds. |
ThreadInfo[] | getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers) Returns the thread info for each thread whose ID is in the input array ids , with stack trace and synchronization information. |
ThreadInfo | getThreadInfo(long id, int maxDepth) Returns a thread info for a thread of the specified id , with stack trace of a specified number of stack trace elements. |
ThreadInfo[] | getThreadInfo(long[] ids, int maxDepth) 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. |
ThreadInfo | getThreadInfo(long id) Returns the thread info for a thread of the specified id with no stack trace. |
ThreadInfo[] | getThreadInfo(long[] ids) Returns the thread info for each thread whose ID is in the input array ids with no stack trace. |
long | getThreadUserTime(long id) Returns the CPU time that a thread of the specified ID has executed in user mode in nanoseconds. |
long | getTotalStartedThreadCount() Returns the total number of threads created and also started since the Java virtual machine started. |
boolean | isCurrentThreadCpuTimeSupported() Tests if the Java virtual machine supports CPU time measurement for the current thread. |
boolean | isObjectMonitorUsageSupported() Tests if the Java virtual machine supports monitoring of object monitor usage. |
boolean | isSynchronizerUsageSupported() Tests if the Java virtual machine supports monitoring of ownable synchronizer usage. |
boolean | isThreadContentionMonitoringEnabled() Tests if thread contention monitoring is enabled. |
boolean | isThreadContentionMonitoringSupported() Tests if the Java virtual machine supports thread contention monitoring. |
boolean | isThreadCpuTimeEnabled() Tests if thread CPU time measurement is enabled. |
boolean | isThreadCpuTimeSupported() Tests if the Java virtual machine implementation supports CPU time measurement for any thread. |
void | setThreadContentionMonitoringEnabled(boolean enable) Enables or disables thread contention monitoring. |
void | setThreadCpuTimeEnabled(boolean enable) Enables or disables thread CPU time measurement. |