Sun GlassFish Enterprise Server 2.1 Administration Guide

JVM Statistics in Java SE

With Java SE, additional monitoring information can be obtained from the JVM. Set the monitoring level to LOW to enable the display of this additional information. Set the monitoring level to HIGH to also view information pertaining to each live thread in the system. More information on the additional monitoring features for Java SE is available in a document titled Monitoring and Management for the Java Platform, which is available from http://java.sun.com/javase/6/docs/technotes/guides/management/.

The Java SE monitoring tools are discussed at http://java.sun.com/javase/6/docs/technotes/tools/#manage.

The statistics available for class loading in the JVM in Java SE are shown in the following table.

Table 18–17 JVM Statistics for Java SE- Class Loading

Statistic 

Data Type 

Description 

loadedclasscount

CountStatistic 

Number of classes that are currently loaded in the JVM. 

totalloadedclasscount

CountStatistic 

Total number of classes that have been loaded since the JVM began execution. 

unloadedclasscount

CountStatistic 

Number of classes that have been unloaded from the JVM since the JVM began execution. 

The statistics available for compilation in the JVM in Java SE are shown in the following table.

Table 18–18 JVM Statistics for Java SE- Compilation

Statistic 

Data Type 

Description 

totalcompilationtime

CountStatistic 

Accumulated time (in milliseconds) spent in compilation. 

The statistics available for garbage collection in the JVM in Java SE are shown in the following table.

Table 18–19 JVM Statistics for Java SE- Garbage Collection

Statistic 

Data Type 

Description 

collectioncount

CountStatistic 

Total number of collections that have occurred. 

collectiontime

CountStatistic 

Accumulated collection time (in milliseconds). 

The statistics available for memory in the JVM in Java SE are shown in the following table.

Table 18–20 JVM Statistics for Java SE- Memory

Statistic 

Data Type 

Description 

objectpendingfinalizationcount

CountStatistic 

Approximate number of objects that are pending finalization. 

initheapsize

CountStatistic 

Size of the heap initially requested by the JVM. 

usedheapsize

CountStatistic 

Size of the heap currently in use. 

maxheapsize

CountStatistic 

Maximum amount of memory (in bytes) that can be used for memory management. 

committedheapsize

CountStatistic 

Amount of memory (in bytes) that is committed for the JVM to use. 

initnonheapsize

CountStatistic 

Size of the non-heap area initially requested by the JVM. 

usednonheapsize

CountStatistic 

Size of the non-heap area currently in use. 

maxnonheapsize

CountStatistic 

Maximum amount of memory (in bytes) that can be used for memory management. 

committednonheapsize

CountStatistic 

Amount of memory (in bytes) that is committed for the JVM to use. 

The statistics available for the operating system in the JVM in Java SE are shown in the following table.

Table 18–21 JVM Statistics for Java SE - Operating System

Statistic 

Data Type 

Description 

arch

StringStatistic 

Operating system architecture. 

availableprocessors

CountStatistic 

Number of processors available to the JVM. 

name

StringStatistic 

Operating system name. 

version

StringStatistic 

Operating system version. 

The statistics available for the runtime in the JVM in Java SE are shown in the following table.

Table 18–22 JVM Statistics for Java SE - Runtime

Statistic 

Data Type 

Description 

name

StringStatistic 

Name representing the running JVM 

vmname

StringStatistic 

JVM implementation name. 

vmvendor

StringStatistic 

JVM implementation vendor. 

vmversion

StringStatistic 

JVM implementation version. 

specname

StringStatistic 

JVM specification name. 

specvendor

StringStatistic 

JVM specification vendor. 

specversion

StringStatistic 

JVM specification version. 

managementspecversion

StringStatistic 

Management spec. version implemented by the JVM. 

classpath

StringStatistic 

Classpath that is used by the system class loader to search for class files. 

librarypath

StringStatistic 

Java library path. 

bootclasspath

StringStatistic 

Classpath that is used by the bootstrap class loader to search for class files. 

inputarguments

StringStatistic 

Input arguments passed to the JVM. Does not include the arguments to the main method.

uptime

CountStatistic 

Uptime of the JVM (in milliseconds). 

The statistics available for ThreadInfo in the JVM in Java SE are shown in the following table.

Table 18–23 JVM Statistics for Java SE - Thread Info

Statistic 

Data Type 

Description 

threadid

CountStatistic 

ID of the thread. 

threadname

StringStatistic 

Name of the thread. 

threadstate

StringStatistic 

State of the thread. 

blockedtime

CountStatistic 

Time elapsed (in milliseconds) since the thread entered the BLOCKED state. Returns -1 if thread contention monitoring is disabled.

blockedcount

CountStatistic 

Total number of times that the thread entered the BLOCKED state.

waitedtime

CountStatistic 

Elapsed time (in milliseconds) that the thread has been in a WAITING state. Returns -1 if thread contention monitoring is disabled.

waitedcount

CountStatistic 

Total number of times the thread was in WAITING or TIMED_WAITING states.

lockname

StringStatistic 

String representation of the monitor lock that the thread is blocked to enter or waiting to be notified through the Object.wait method.

lockownerid

CountStatistic 

ID of the thread that holds the monitor lock of an object on which this thread is blocking. 

lockownername

StringStatistic 

Name of the thread that holds the monitor lock of the object this thread is blocking on. 

stacktrace

StringStatistic 

Stack trace associated with this thread. 

The statistics available for threads in the JVM in Java SE are shown in the following table.

Table 18–24 JVM Statistics for Java SE - Threads

Statistic 

Data Type 

Description 

threadcount

CountStatistic 

Current number of live daemon and non-daemon threads. 

peakthreadcount

CountStatistic 

Peak live thread count since the JVM started or the peak was reset. 

totalstartedthreadcount

CountStatistic 

Total number of threads created and/or started since the JVM started. 

daemonthreadcount

CountStatistic 

Current number of live daemon threads. 

allthreadids

StringStatistic 

List of all live thread ids. 

currentthreadcputime

CountStatistic 

CPU time for the current thread (in nanoseconds) if CPU time measurement is enabled. If CPU time measurement is disabled, returns -1. 

monitordeadlockedthreads

StringStatistic 

List of thread ids that are monitor deadlocked.