public interface

OperatingSystemMXBean

implements OperatingSystemMXBean
com.sun.management.OperatingSystemMXBean
Known Indirect Subclasses

Class Overview

Platform-specific management interface for the operating system on which the Java virtual machine is running.

The OperatingSystemMXBean object returned by getOperatingSystemMXBean() is an instance of the implementation class of this interface or UnixOperatingSystemMXBean interface depending on its underlying operating system.

Summary

Public Methods
abstract long getCommittedVirtualMemorySize()
Returns the amount of virtual memory that is guaranteed to be available to the running process in bytes, or -1 if this operation is not supported.
abstract long getFreePhysicalMemorySize()
Returns the amount of free physical memory in bytes.
abstract long getFreeSwapSpaceSize()
Returns the amount of free swap space in bytes.
abstract long getProcessCpuTime()
Returns the CPU time used by the process on which the Java virtual machine is running in nanoseconds.
abstract long getTotalPhysicalMemorySize()
Returns the total amount of physical memory in bytes.
abstract long getTotalSwapSpaceSize()
Returns the total amount of swap space in bytes.
[Expand]
Inherited Methods
From interface java.lang.management.OperatingSystemMXBean

Public Methods

public abstract long getCommittedVirtualMemorySize ()

Returns the amount of virtual memory that is guaranteed to be available to the running process in bytes, or -1 if this operation is not supported.

Returns
  • the amount of virtual memory that is guaranteed to be available to the running process in bytes, or -1 if this operation is not supported.

public abstract long getFreePhysicalMemorySize ()

Returns the amount of free physical memory in bytes.

Returns
  • the amount of free physical memory in bytes.

public abstract long getFreeSwapSpaceSize ()

Returns the amount of free swap space in bytes.

Returns
  • the amount of free swap space in bytes.

public abstract long getProcessCpuTime ()

Returns the CPU time used by the process on which the Java virtual machine is running in nanoseconds. The returned value is of nanoseconds precision but not necessarily nanoseconds accuracy. This method returns -1 if the the platform does not support this operation.

Returns
  • the CPU time used by the process in nanoseconds, or -1 if this operation is not supported.

public abstract long getTotalPhysicalMemorySize ()

Returns the total amount of physical memory in bytes.

Returns
  • the total amount of physical memory in bytes.

public abstract long getTotalSwapSpaceSize ()

Returns the total amount of swap space in bytes.

Returns
  • the total amount of swap space in bytes.