final class VMThreadMXBeanImpl extends Object
Constructor and Description |
---|
VMThreadMXBeanImpl() |
Modifier and Type | Method and Description |
---|---|
(package private) static long[] |
findDeadlockedThreads()
Returns the ids of deadlocked threads occurring due
to either monitor or ownable synchronizer ownership.
|
(package private) static long[] |
findMonitorDeadlockedThreads()
Returns the ids of deadlocked threads occurring due
to monitor ownership.
|
(package private) static long[] |
getAllThreadIds()
Returns the identifiers of all live threads.
|
(package private) static long |
getCurrentThreadCpuTime()
Returns the number of nanoseconds of CPU time
the current thread has used, if supported.
|
(package private) static long |
getCurrentThreadUserTime()
Returns the number of nanoseconds of user time
the current thread has used, if supported.
|
(package private) static int |
getDaemonThreadCount()
Returns the number of live daemon threads.
|
private static long |
getIDForCurrentThread() |
(package private) static void |
getLockInfo(ThreadInfo info)
Fills out the information on ownable synchronizers
in the given
ThreadInfo
object if supported. |
(package private) static void |
getMonitorInfo(ThreadInfo info)
Fills out the information on monitor usage
in the given
ThreadInfo
object if supported. |
(package private) static int |
getPeakThreadCount()
Returns the current peak number of live threads.
|
(package private) static int |
getThreadCount()
Returns the current number of live threads.
|
(package private) static long |
getThreadCpuTime(long id)
Returns the number of nanoseconds of CPU time
the given thread has used, if supported.
|
private static Thread |
getThreadForId(long id)
Returns the Thread instance for the given
thread id.
|
(package private) static ThreadInfo |
getThreadInfoForId(long id,
int maxDepth)
Returns a
ThreadInfo
object for the given thread id with a stack trace to
the given depth (0 for empty, Integer.MAX_VALUE for
full). |
(package private) static long |
getThreadUserTime(long id)
Returns the number of nanoseconds of user time
the given thread has used, if supported.
|
(package private) static long |
getTotalStartedThreadCount()
Returns the number of threads started.
|
(package private) static void |
resetPeakThreadCount()
Resets the peak thread count.
|
VMThreadMXBeanImpl()
static long[] findDeadlockedThreads()
static long[] findMonitorDeadlockedThreads()
static long[] getAllThreadIds()
static long getCurrentThreadCpuTime()
private static long getIDForCurrentThread()
static long getCurrentThreadUserTime()
static int getDaemonThreadCount()
static void getLockInfo(ThreadInfo info)
ThreadInfo
object if supported.info
- the object to fill in.static void getMonitorInfo(ThreadInfo info)
ThreadInfo
object if supported.info
- the object to fill in.static int getPeakThreadCount()
static int getThreadCount()
static long getThreadCpuTime(long id)
id
- the id of the thread to probe.static ThreadInfo getThreadInfoForId(long id, int maxDepth)
ThreadInfo
object for the given thread id with a stack trace to
the given depth (0 for empty, Integer.MAX_VALUE for
full).id
- the id of the thread whose info should be returned.maxDepth
- the depth of the stack trace.ThreadInfo
instance.private static Thread getThreadForId(long id)
id
- the id of the thread to find.static long getThreadUserTime(long id)
id
- the id of the thread to probe.static long getTotalStartedThreadCount()
static void resetPeakThreadCount()