jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java
changeset 30355 e37c7eba132f
parent 25859 3317bb8137f4
child 32210 958d823579c3
equal deleted inserted replaced
30354:ca83b4cae363 30355:e37c7eba132f
       
     1 /*
       
     2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.  Oracle designates this
       
     8  * particular file as subject to the "Classpath" exception as provided
       
     9  * by Oracle in the LICENSE file that accompanied this code.
       
    10  *
       
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14  * version 2 for more details (a copy is included in the LICENSE file that
       
    15  * accompanied this code).
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License version
       
    18  * 2 along with this work; if not, write to the Free Software Foundation,
       
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20  *
       
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    22  * or visit www.oracle.com if you need additional information or have any
       
    23  * questions.
       
    24  */
       
    25 
       
    26 package com.sun.management;
       
    27 
       
    28 /**
       
    29  * Platform-specific management interface for the operating system
       
    30  * on which the Java virtual machine is running.
       
    31  *
       
    32  * <p>
       
    33  * The <tt>OperatingSystemMXBean</tt> object returned by
       
    34  * {@link java.lang.management.ManagementFactory#getOperatingSystemMXBean()}
       
    35  * is an instance of the implementation class of this interface
       
    36  * or {@link UnixOperatingSystemMXBean} interface depending on
       
    37  * its underlying operating system.
       
    38  *
       
    39  * @author  Mandy Chung
       
    40  * @since   1.5
       
    41  */
       
    42 @jdk.Exported
       
    43 public interface OperatingSystemMXBean extends
       
    44     java.lang.management.OperatingSystemMXBean {
       
    45 
       
    46     /**
       
    47      * Returns the amount of virtual memory that is guaranteed to
       
    48      * be available to the running process in bytes,
       
    49      * or <tt>-1</tt> if this operation is not supported.
       
    50      *
       
    51      * @return the amount of virtual memory that is guaranteed to
       
    52      * be available to the running process in bytes,
       
    53      * or <tt>-1</tt> if this operation is not supported.
       
    54      */
       
    55     public long getCommittedVirtualMemorySize();
       
    56 
       
    57     /**
       
    58      * Returns the total amount of swap space in bytes.
       
    59      *
       
    60      * @return the total amount of swap space in bytes.
       
    61      */
       
    62     public long getTotalSwapSpaceSize();
       
    63 
       
    64     /**
       
    65      * Returns the amount of free swap space in bytes.
       
    66      *
       
    67      * @return the amount of free swap space in bytes.
       
    68      */
       
    69     public long getFreeSwapSpaceSize();
       
    70 
       
    71     /**
       
    72      * Returns the CPU time used by the process on which the Java
       
    73      * virtual machine is running in nanoseconds.  The returned value
       
    74      * is of nanoseconds precision but not necessarily nanoseconds
       
    75      * accuracy.  This method returns <tt>-1</tt> if the
       
    76      * the platform does not support this operation.
       
    77      *
       
    78      * @return the CPU time used by the process in nanoseconds,
       
    79      * or <tt>-1</tt> if this operation is not supported.
       
    80      */
       
    81     public long getProcessCpuTime();
       
    82 
       
    83     /**
       
    84      * Returns the amount of free physical memory in bytes.
       
    85      *
       
    86      * @return the amount of free physical memory in bytes.
       
    87      */
       
    88     public long getFreePhysicalMemorySize();
       
    89 
       
    90     /**
       
    91      * Returns the total amount of physical memory in bytes.
       
    92      *
       
    93      * @return the total amount of physical memory in  bytes.
       
    94      */
       
    95     public long getTotalPhysicalMemorySize();
       
    96 
       
    97     /**
       
    98      * Returns the "recent cpu usage" for the whole system. This value is a
       
    99      * double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs
       
   100      * were idle during the recent period of time observed, while a value
       
   101      * of 1.0 means that all CPUs were actively running 100% of the time
       
   102      * during the recent period being observed. All values betweens 0.0 and
       
   103      * 1.0 are possible depending of the activities going on in the system.
       
   104      * If the system recent cpu usage is not available, the method returns a
       
   105      * negative value.
       
   106      *
       
   107      * @return the "recent cpu usage" for the whole system; a negative
       
   108      * value if not available.
       
   109      * @since   1.7
       
   110      */
       
   111     public double getSystemCpuLoad();
       
   112 
       
   113     /**
       
   114      * Returns the "recent cpu usage" for the Java Virtual Machine process.
       
   115      * This value is a double in the [0.0,1.0] interval. A value of 0.0 means
       
   116      * that none of the CPUs were running threads from the JVM process during
       
   117      * the recent period of time observed, while a value of 1.0 means that all
       
   118      * CPUs were actively running threads from the JVM 100% of the time
       
   119      * during the recent period being observed. Threads from the JVM include
       
   120      * the application threads as well as the JVM internal threads. All values
       
   121      * betweens 0.0 and 1.0 are possible depending of the activities going on
       
   122      * in the JVM process and the whole system. If the Java Virtual Machine
       
   123      * recent CPU usage is not available, the method returns a negative value.
       
   124      *
       
   125      * @return the "recent cpu usage" for the Java Virtual Machine process;
       
   126      * a negative value if not available.
       
   127      * @since   1.7
       
   128      */
       
   129     public double getProcessCpuLoad();
       
   130 
       
   131 }