APIdia Launch Partner
Top Constructors Methods
com.sun.management.internal

public Class HotSpotThreadImpl

extends ThreadImpl
implements ThreadMXBean
Class Inheritance
All Implemented Interfaces
com.sun.management.ThreadMXBean, java.lang.management.ThreadMXBean, java.lang.management.PlatformManagedObject
Imports
com.sun.management.ThreadMXBean, sun.management.ManagementFactoryHelper, .ThreadImpl, .VMManagement

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public long
getCurrentThreadAllocatedBytes()

Overrides sun.management.ThreadImpl.getCurrentThreadAllocatedBytes.

Overrides default com.sun.management.ThreadMXBean.getCurrentThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the current thread.

public long
getThreadAllocatedBytes(long id)

Overrides sun.management.ThreadImpl.getThreadAllocatedBytes.

Implements com.sun.management.ThreadMXBean.getThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the thread with the specified ID. The returned value is an approximation because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.

public long[]
getThreadAllocatedBytes(long[] ids)

Overrides sun.management.ThreadImpl.getThreadAllocatedBytes.

Implements com.sun.management.ThreadMXBean.getThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for each thread whose ID is in the input array ids.

public long[]
getThreadCpuTime(long[] ids)

Overrides sun.management.ThreadImpl.getThreadCpuTime.

Implements com.sun.management.ThreadMXBean.getThreadCpuTime.

Returns the total CPU time for each thread whose ID is in the input array ids in nanoseconds.

public long[]
getThreadUserTime(long[] ids)

Overrides sun.management.ThreadImpl.getThreadUserTime.

Implements com.sun.management.ThreadMXBean.getThreadUserTime.

Returns the CPU time that each thread whose ID is in the input array ids has executed in user mode in nanoseconds.

public long
getTotalThreadAllocatedBytes()

Overrides sun.management.ThreadImpl.getTotalThreadAllocatedBytes.

Overrides default com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory by all threads since the Java virtual machine started.

public boolean
public boolean
isThreadAllocatedMemorySupported()

Overrides sun.management.ThreadImpl.isThreadAllocatedMemorySupported.

Implements com.sun.management.ThreadMXBean.isThreadAllocatedMemorySupported.

Tests if the Java virtual machine implementation supports thread memory allocation measurement.

public void
Inherited from sun.management.ThreadImpl:
dumpAllThreadsdumpAllThreadsfindDeadlockedThreadsfindMonitorDeadlockedThreadsgetAllThreadIdsgetCurrentThreadCpuTimegetCurrentThreadUserTimegetDaemonThreadCountgetObjectNamegetPeakThreadCountgetThreadCountgetThreadCpuTimegetThreadInfogetThreadInfogetThreadInfogetThreadInfogetThreadInfogetThreadInfogetThreadUserTimegetTotalStartedThreadCountisCurrentThreadCpuTimeSupportedisObjectMonitorUsageSupportedisSynchronizerUsageSupportedisThreadContentionMonitoringEnabledisThreadContentionMonitoringSupportedisThreadCpuTimeEnabledisThreadCpuTimeSupportedresetPeakThreadCountsetThreadContentionMonitoringEnabledsetThreadCpuTimeEnabled

Constructor Detail

HotSpotThreadImplback to summary
public HotSpotThreadImpl(VMManagement vm)

Method Detail

getCurrentThreadAllocatedBytesback to summary
public long getCurrentThreadAllocatedBytes()

Overrides sun.management.ThreadImpl.getCurrentThreadAllocatedBytes.

Overrides default com.sun.management.ThreadMXBean.getCurrentThreadAllocatedBytes.

Doc from com.sun.management.ThreadMXBean.getCurrentThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the current thread. The returned value is an approximation because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.

This is a convenience method for local management use and is equivalent to calling:

  getThreadAllocatedBytes(Thread.currentThread().threadId());
Annotations
@Override
getThreadAllocatedBytesback to summary
public long getThreadAllocatedBytes(long id)

Overrides sun.management.ThreadImpl.getThreadAllocatedBytes.

Implements com.sun.management.ThreadMXBean.getThreadAllocatedBytes.

Doc from com.sun.management.ThreadMXBean.getThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the thread with the specified ID. The returned value is an approximation because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.

If the thread with the specified ID is a virtual thread, is not alive, or does not exist, this method returns -1. If thread memory allocation measurement is disabled, this method returns -1. A thread is alive if it has been started and has not yet terminated.

If thread memory allocation 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 thread memory allocation measurement starts.

Annotations
@Override
getThreadAllocatedBytesback to summary
public long[] getThreadAllocatedBytes(long[] ids)

Overrides sun.management.ThreadImpl.getThreadAllocatedBytes.

Implements com.sun.management.ThreadMXBean.getThreadAllocatedBytes.

Doc from com.sun.management.ThreadMXBean.getThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for each thread whose ID is in the input array ids. The returned values are approximations because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.

This method is equivalent to calling the getThreadAllocatedBytes(long) method for each thread ID in the input array ids and setting the returned value in the corresponding element of the returned array.

Annotations
@Override
getThreadCpuTimeback to summary
public long[] getThreadCpuTime(long[] ids)

Overrides sun.management.ThreadImpl.getThreadCpuTime.

Implements com.sun.management.ThreadMXBean.getThreadCpuTime.

Doc from com.sun.management.ThreadMXBean.getThreadCpuTime.

Returns the total CPU time for each thread whose ID is in the input array ids in nanoseconds. The returned values are of nanoseconds precision but not necessarily nanoseconds accuracy.

This method is equivalent to calling the ThreadMXBean#getThreadCpuTime(long) method for each thread ID in the input array ids and setting the returned value in the corresponding element of the returned array.

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

Overrides sun.management.ThreadImpl.getThreadUserTime.

Implements com.sun.management.ThreadMXBean.getThreadUserTime.

Doc from com.sun.management.ThreadMXBean.getThreadUserTime.

Returns the CPU time that each thread whose ID is in the input array ids has executed in user mode in nanoseconds. The returned values are of nanoseconds precision but not necessarily nanoseconds accuracy.

This method is equivalent to calling the ThreadMXBean#getThreadUserTime(long) method for each thread ID in the input array ids and setting the returned value in the corresponding element of the returned array.

Annotations
@Override
getTotalThreadAllocatedBytesback to summary
public long getTotalThreadAllocatedBytes()

Overrides sun.management.ThreadImpl.getTotalThreadAllocatedBytes.

Overrides default com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes.

Doc from com.sun.management.ThreadMXBean.getTotalThreadAllocatedBytes.

Returns an approximation of the total amount of memory, in bytes, allocated in heap memory by all threads since the Java virtual machine started. The returned value is an approximation because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.

Annotations
@Override
isThreadAllocatedMemoryEnabledback to summary
public boolean isThreadAllocatedMemoryEnabled()

Overrides sun.management.ThreadImpl.isThreadAllocatedMemoryEnabled.

Implements com.sun.management.ThreadMXBean.isThreadAllocatedMemoryEnabled.

Doc from com.sun.management.ThreadMXBean.isThreadAllocatedMemoryEnabled.

Tests if thread memory allocation measurement is enabled.

Annotations
@Override
isThreadAllocatedMemorySupportedback to summary
public boolean isThreadAllocatedMemorySupported()

Overrides sun.management.ThreadImpl.isThreadAllocatedMemorySupported.

Implements com.sun.management.ThreadMXBean.isThreadAllocatedMemorySupported.

Doc from com.sun.management.ThreadMXBean.isThreadAllocatedMemorySupported.

Tests if the Java virtual machine implementation supports thread memory allocation measurement.

Annotations
@Override
setThreadAllocatedMemoryEnabledback to summary
public void setThreadAllocatedMemoryEnabled(boolean enable)

Overrides sun.management.ThreadImpl.setThreadAllocatedMemoryEnabled.

Implements com.sun.management.ThreadMXBean.setThreadAllocatedMemoryEnabled.

Doc from com.sun.management.ThreadMXBean.setThreadAllocatedMemoryEnabled.

Enables or disables thread memory allocation measurement. The default is platform dependent.

Annotations
@Override