0N/A/*
2362N/A * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.management;
0N/A
0N/A/**
0N/A * Platform-specific management interface for the operating system
0N/A * on which the Java virtual machine is running.
0N/A *
0N/A * <p>
0N/A * The <tt>OperatingSystemMXBean</tt> object returned by
0N/A * {@link java.lang.management.ManagementFactory#getOperatingSystemMXBean()}
0N/A * is an instance of the implementation class of this interface
0N/A * or {@link UnixOperatingSystemMXBean} interface depending on
0N/A * its underlying operating system.
0N/A *
0N/A * @author Mandy Chung
0N/A * @since 1.5
0N/A */
0N/Apublic interface OperatingSystemMXBean extends
0N/A java.lang.management.OperatingSystemMXBean {
0N/A
0N/A /**
0N/A * Returns the amount of virtual memory that is guaranteed to
0N/A * be available to the running process in bytes,
0N/A * or <tt>-1</tt> if this operation is not supported.
0N/A *
0N/A * @return the amount of virtual memory that is guaranteed to
0N/A * be available to the running process in bytes,
0N/A * or <tt>-1</tt> if this operation is not supported.
0N/A */
0N/A public long getCommittedVirtualMemorySize();
0N/A
0N/A /**
0N/A * Returns the total amount of swap space in bytes.
0N/A *
0N/A * @return the total amount of swap space in bytes.
0N/A */
0N/A public long getTotalSwapSpaceSize();
0N/A
0N/A /**
0N/A * Returns the amount of free swap space in bytes.
0N/A *
0N/A * @return the amount of free swap space in bytes.
0N/A */
0N/A public long getFreeSwapSpaceSize();
0N/A
0N/A /**
0N/A * Returns the CPU time used by the process on which the Java
0N/A * virtual machine is running in nanoseconds. The returned value
0N/A * is of nanoseconds precision but not necessarily nanoseconds
0N/A * accuracy. This method returns <tt>-1</tt> if the
0N/A * the platform does not support this operation.
0N/A *
0N/A * @return the CPU time used by the process in nanoseconds,
0N/A * or <tt>-1</tt> if this operation is not supported.
0N/A */
0N/A public long getProcessCpuTime();
0N/A
0N/A /**
0N/A * Returns the amount of free physical memory in bytes.
0N/A *
0N/A * @return the amount of free physical memory in bytes.
0N/A */
0N/A public long getFreePhysicalMemorySize();
0N/A
0N/A /**
0N/A * Returns the total amount of physical memory in bytes.
0N/A *
0N/A * @return the total amount of physical memory in bytes.
0N/A */
0N/A public long getTotalPhysicalMemorySize();
4162N/A
4162N/A /**
4162N/A * Returns the "recent cpu usage" for the whole system. This value is a
4162N/A * double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs
4162N/A * were idle during the recent period of time observed, while a value
4162N/A * of 1.0 means that all CPUs were actively running 100% of the time
4162N/A * during the recent period being observed. All values betweens 0.0 and
4162N/A * 1.0 are possible depending of the activities going on in the system.
4162N/A * If the system recent cpu usage is not available, the method returns a
4162N/A * negative value.
4162N/A *
4162N/A * @return the "recent cpu usage" for the whole system; a negative
4162N/A * value if not available.
4162N/A * @since 1.7
4162N/A */
4162N/A public double getSystemCpuLoad();
4162N/A
4162N/A /**
4162N/A * Returns the "recent cpu usage" for the Java Virtual Machine process.
4162N/A * This value is a double in the [0.0,1.0] interval. A value of 0.0 means
4162N/A * that none of the CPUs were running threads from the JVM process during
4162N/A * the recent period of time observed, while a value of 1.0 means that all
4162N/A * CPUs were actively running threads from the JVM 100% of the time
4162N/A * during the recent period being observed. Threads from the JVM include
4162N/A * the application threads as well as the JVM internal threads. All values
4162N/A * betweens 0.0 and 1.0 are possible depending of the activities going on
4162N/A * in the JVM process and the whole system. If the Java Virtual Machine
4162N/A * recent CPU usage is not available, the method returns a negative value.
4162N/A *
4162N/A * @return the "recent cpu usage" for the Java Virtual Machine process;
4162N/A * a negative value if not available.
4162N/A * @since 1.7
4162N/A */
4162N/A public double getProcessCpuLoad();
4162N/A
0N/A}