public class JMXSupport extends Object
Modifier and Type | Field and Description |
---|---|
private static int |
peakThreadCount |
private static Lock |
peakThreadCountLock |
private static long |
startedThreadCount |
private static Lock |
startedThreadCountLock |
private static HashMap<Long,Thread> |
threadIdToThread |
Constructor and Description |
---|
JMXSupport() |
Modifier and Type | Method and Description |
---|---|
static long[] |
getAllLiveThreadIds() |
static int |
getLiveDaemonCount() |
static int |
getLiveThreadCount() |
static int |
getPeakThreadCount() |
static StackTraceElement[] |
getStackTraceForThread(RVMThread rvmThread) |
static long |
getStartedThreadCount() |
static Thread |
getThreadForId(long id) |
static long |
getWaitingCount(RVMThread rvmThread) |
static long |
getWaitingTime(RVMThread rvmThread) |
(package private) static void |
increaseStartedThreadCount()
Increases the number of started threads
Note: this must be uninterruptible because it's called from the
RVMThread.start() and that method must not have yieldpoints. |
static boolean |
isInNative(RVMThread t)
Checks whether the thread is in native according to JMX.
|
static boolean |
isSuspended(RVMThread t)
Checks whether the thread is currently suspended
according to JMX.
|
static void |
resetPeakThreadCount() |
(package private) static void |
updatePeakThreadCount(int liveThreadCount,
int numActiveSystemThreads)
Updates the current peak thread count.
|
private static HashMap<Long,Thread> threadIdToThread
private static final Lock peakThreadCountLock
private static int peakThreadCount
private static final Lock startedThreadCountLock
private static long startedThreadCount
public JMXSupport()
static void updatePeakThreadCount(int liveThreadCount, int numActiveSystemThreads)
Note: this must be uninterruptible because it's called from the
RVMThread.start()
and that method must not have yieldpoints.
liveThreadCount
- the current count of live threadsnumActiveSystemThreads
- the current count of live system threadspublic static int getPeakThreadCount()
public static void resetPeakThreadCount()
static void increaseStartedThreadCount()
Note: this must be uninterruptible because it's called from the
RVMThread.start()
and that method must not have yieldpoints.
public static long getStartedThreadCount()
public static int getLiveThreadCount()
public static int getLiveDaemonCount()
public static long[] getAllLiveThreadIds()
public static Thread getThreadForId(long id)
public static boolean isInNative(RVMThread t)
t
- a threadpublic static boolean isSuspended(RVMThread t)
t
- a threadThread.suspend()
was called on the
threadpublic static long getWaitingCount(RVMThread rvmThread)
public static long getWaitingTime(RVMThread rvmThread)
public static StackTraceElement[] getStackTraceForThread(RVMThread rvmThread)