com.sun.management

## Interface OperatingSystemMXBean

All Superinterfaces:
  OperatingSystemMXBean

All Known Subinterfaces:
  UnixOperatingSystemMXBean

    public interface OperatingSystemMXBean
    extends OperatingSystemMXBean

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

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

Since:
  1.5

### Method Summary

Methods
`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.
`long` `getFreePhysicalMemorySize()` Returns the amount of free physical memory in bytes.
`long` `getFreeSwapSpaceSize()` Returns the amount of free swap space in bytes.
`long` `getProcessCpuTime()` Returns the CPU time used by the process on which the Java virtual machine is running in nanoseconds.
`long` `getTotalPhysicalMemorySize()` Returns the total amount of physical memory in bytes.
`long` `getTotalSwapSpaceSize()` Returns the total amount of swap space in bytes.

### Methods inherited from interface java.lang.management.OperatingSystemMXBean

`getArch, getAvailableProcessors, getName, getSystemLoadAverage, getVersion`

### Method Detail

#### getCommittedVirtualMemorySize

    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.

#### getTotalSwapSpaceSize

    long getTotalSwapSpaceSize()

Returns the total amount of swap space in bytes.

Returns:
  the total amount of swap space in bytes.

#### getFreeSwapSpaceSize

    long getFreeSwapSpaceSize()

Returns the amount of free swap space in bytes.

Returns:
  the amount of free swap space in bytes.

#### getProcessCpuTime

    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.

#### getFreePhysicalMemorySize

    long getFreePhysicalMemorySize()

Returns the amount of free physical memory in bytes.

Returns:
  the amount of free physical memory in bytes.

#### getTotalPhysicalMemorySize

    long getTotalPhysicalMemorySize()

Returns the total amount of physical memory in bytes.

Returns:
  the total amount of physical memory in bytes.

Copyright © 2003, 2014, Oracle and/or its affiliates. All rights reserved.