com.sun.btrace
Class BTraceUtils.Sys.VM

java.lang.Object
  extended by com.sun.btrace.BTraceUtils.Sys.VM
Enclosing class:
BTraceUtils.Sys

public static class BTraceUtils.Sys.VM
extends java.lang.Object


Constructor Summary
BTraceUtils.Sys.VM()
           
 
Method Summary
static java.lang.String bootClassPath()
          Returns the boot class path that is used by the bootstrap class loader to search for class files.
static java.lang.String classPath()
          Returns the Java class path that is used by the system class loader to search for class files.
static long currentThreadCpuTime()
          Returns the total CPU time for the current thread in nanoseconds.
static long currentThreadUserTime()
          Returns the CPU time that the current thread has executed in user mode in nanoseconds.
static long daemonThreadCount()
          Returns the current number of live daemon threads.
static boolean isBootClassPathSupported()
          Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.
static java.lang.String libraryPath()
          Returns the Java library path.
static long peakThreadCount()
          Returns the peak live thread count since the Java virtual machine started or peak was reset.
static void printVmArguments()
          Prints VM input arguments list.
static long threadCount()
          Returns the current number of live threads including both daemon and non-daemon threads.
static long totalStartedThreadCount()
          Returns the total number of threads created and also started since the Java virtual machine started.
static java.util.List<java.lang.String> vmArguments()
          Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method.
static long vmStartTime()
          Returns the start time of the Java virtual machine in milliseconds.
static long vmUptime()
          Returns the uptime of the Java virtual machine in milliseconds.
static java.lang.String vmVersion()
          Returns the Java virtual machine implementation version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTraceUtils.Sys.VM

public BTraceUtils.Sys.VM()
Method Detail

vmArguments

public static java.util.List<java.lang.String> vmArguments()
Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method. This method returns an empty list if there is no input argument to the Java virtual machine.

Some Java virtual machine implementations may take input arguments from multiple different sources: for examples, arguments passed from the application that launches the Java virtual machine such as the 'java' command, environment variables, configuration files, etc.

Typically, not all command-line options to the 'java' command are passed to the Java virtual machine. Thus, the returned input arguments may not include all command-line options.

Returns:
a list of String objects; each element is an argument passed to the Java virtual machine.

printVmArguments

public static void printVmArguments()
Prints VM input arguments list.

See Also:
vmArguments()

vmVersion

public static java.lang.String vmVersion()
Returns the Java virtual machine implementation version. This method is equivalent to Sys.getProperty("java.vm.version")}.

Returns:
the Java virtual machine implementation version.

isBootClassPathSupported

public static boolean isBootClassPathSupported()
Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.

Returns:
true if the Java virtual machine supports the class path mechanism; false otherwise.

bootClassPath

public static java.lang.String bootClassPath()
Returns the boot class path that is used by the bootstrap class loader to search for class files.

Multiple paths in the boot class path are separated by the path separator character of the platform on which the Java virtual machine is running.

A Java virtual machine implementation may not support the boot class path mechanism for the bootstrap class loader to search for class files. The isBootClassPathSupported() method can be used to determine if the Java virtual machine supports this method.

Returns:
the boot class path.
Throws:
java.lang.UnsupportedOperationException - if the Java virtual machine does not support this operation.

classPath

public static java.lang.String classPath()
Returns the Java class path that is used by the system class loader to search for class files. This method is equivalent to Sys.getProperty("java.class.path").

Returns:
the Java class path.

libraryPath

public static java.lang.String libraryPath()
Returns the Java library path. This method is equivalent to Sys.getProperty("java.library.path").

Multiple paths in the Java library path are separated by the path separator character of the platform of the Java virtual machine being monitored.

Returns:
the Java library path.

threadCount

public static long threadCount()
Returns the current number of live threads including both daemon and non-daemon threads.

Returns:
the current number of live threads.

peakThreadCount

public static long peakThreadCount()
Returns the peak live thread count since the Java virtual machine started or peak was reset.

Returns:
the peak live thread count.

totalStartedThreadCount

public static long totalStartedThreadCount()
Returns the total number of threads created and also started since the Java virtual machine started.

Returns:
the total number of threads started.

daemonThreadCount

public static long daemonThreadCount()
Returns the current number of live daemon threads.

Returns:
the current number of live daemon threads.

vmStartTime

public static long vmStartTime()
Returns the start time of the Java virtual machine in milliseconds. This method returns the approximate time when the Java virtual machine started.

Returns:
start time of the Java virtual machine in milliseconds.

vmUptime

public static long vmUptime()
Returns the uptime of the Java virtual machine in milliseconds.

Returns:
uptime of the Java virtual machine in milliseconds.

currentThreadCpuTime

public static long currentThreadCpuTime()
Returns the total CPU time for the current thread in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy. If the implementation distinguishes between user mode time and system mode time, the returned CPU time is the amount of time that the current thread has executed in user mode or system mode.


currentThreadUserTime

public static long currentThreadUserTime()
Returns the CPU time that the current thread has executed in user mode in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy.