OperatingSystemMXBean (Java SE 15 & JDK 15) (original) (raw)

All Superinterfaces:

[OperatingSystemMXBean](../../../../java.management/java/lang/management/OperatingSystemMXBean.html "interface in java.lang.management"), [PlatformManagedObject](../../../../java.management/java/lang/management/PlatformManagedObject.html "interface in java.lang.management")

All Known Subinterfaces:

[UnixOperatingSystemMXBean](UnixOperatingSystemMXBean.html "interface in com.sun.management")


public interface OperatingSystemMXBean extends OperatingSystemMXBean

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

This interface provides information about the operating environment on which the Java virtual machine is running. That might be a native operating system, a virtualized operating system environment, or a container-managed environment.

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

Since:

1.5

Modifier and Type Method Description
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.
double getCpuLoad() Returns the "recent cpu usage" for the operating environment.
long getFreeMemorySize() Returns the amount of free memory in bytes.
default long getFreePhysicalMemorySize() Deprecated.
long getFreeSwapSpaceSize() Returns the amount of free swap space in bytes.
double getProcessCpuLoad() Returns the "recent cpu usage" for the Java Virtual Machine process.
long getProcessCpuTime() Returns the CPU time used by the process on which the Java virtual machine is running in nanoseconds.
default double getSystemCpuLoad() Deprecated.
long getTotalMemorySize() Returns the total amount of memory in bytes.
default long getTotalPhysicalMemorySize() Deprecated.
long getTotalSwapSpaceSize() Returns the total amount of swap space in bytes.