Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java
38831 views
1
/*
2
* Copyright (c) 2003, 2019, 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
* This interface provides information about the operating environment
34
* on which the Java virtual machine is running. That might be a native
35
* operating system, a virtualized operating system environment, or a
36
* container-managed environment.
37
*
38
* <p>
39
* The <tt>OperatingSystemMXBean</tt> object returned by
40
* {@link java.lang.management.ManagementFactory#getOperatingSystemMXBean()}
41
* is an instance of the implementation class of this interface
42
* or {@link UnixOperatingSystemMXBean} interface depending on
43
* its underlying operating system.
44
*
45
* @author Mandy Chung
46
* @since 1.5
47
*/
48
@jdk.Exported
49
public interface OperatingSystemMXBean extends
50
java.lang.management.OperatingSystemMXBean {
51
52
/**
53
* Returns the amount of virtual memory that is guaranteed to
54
* be available to the running process in bytes,
55
* or <tt>-1</tt> if this operation is not supported.
56
*
57
* @return the amount of virtual memory that is guaranteed to
58
* be available to the running process in bytes,
59
* or <tt>-1</tt> if this operation is not supported.
60
*/
61
public long getCommittedVirtualMemorySize();
62
63
/**
64
* Returns the total amount of swap space in bytes.
65
*
66
* @return the total amount of swap space in bytes.
67
*/
68
public long getTotalSwapSpaceSize();
69
70
/**
71
* Returns the amount of free swap space in bytes.
72
*
73
* @return the amount of free swap space in bytes.
74
*/
75
public long getFreeSwapSpaceSize();
76
77
/**
78
* Returns the CPU time used by the process on which the Java
79
* virtual machine is running in nanoseconds. The returned value
80
* is of nanoseconds precision but not necessarily nanoseconds
81
* accuracy. This method returns <tt>-1</tt> if the
82
* the platform does not support this operation.
83
*
84
* @return the CPU time used by the process in nanoseconds,
85
* or <tt>-1</tt> if this operation is not supported.
86
*/
87
public long getProcessCpuTime();
88
89
/**
90
* Returns the amount of free physical memory in bytes.
91
*
92
* @return the amount of free physical memory in bytes.
93
*/
94
public long getFreePhysicalMemorySize();
95
96
/**
97
* Returns the total amount of physical memory in bytes.
98
*
99
* @return the total amount of physical memory in bytes.
100
*/
101
public long getTotalPhysicalMemorySize();
102
103
/**
104
* Returns the "recent cpu usage" for the whole system. This value is a
105
* double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs
106
* were idle during the recent period of time observed, while a value
107
* of 1.0 means that all CPUs were actively running 100% of the time
108
* during the recent period being observed. All values betweens 0.0 and
109
* 1.0 are possible depending of the activities going on in the system.
110
* If the system recent cpu usage is not available, the method returns a
111
* negative value.
112
*
113
* @return the "recent cpu usage" for the whole system; a negative
114
* value if not available.
115
* @since 1.7
116
*/
117
public double getSystemCpuLoad();
118
119
/**
120
* Returns the "recent cpu usage" for the Java Virtual Machine process.
121
* This value is a double in the [0.0,1.0] interval. A value of 0.0 means
122
* that none of the CPUs were running threads from the JVM process during
123
* the recent period of time observed, while a value of 1.0 means that all
124
* CPUs were actively running threads from the JVM 100% of the time
125
* during the recent period being observed. Threads from the JVM include
126
* the application threads as well as the JVM internal threads. All values
127
* betweens 0.0 and 1.0 are possible depending of the activities going on
128
* in the JVM process and the whole system. If the Java Virtual Machine
129
* recent CPU usage is not available, the method returns a negative value.
130
*
131
* @return the "recent cpu usage" for the Java Virtual Machine process;
132
* a negative value if not available.
133
* @since 1.7
134
*/
135
public double getProcessCpuLoad();
136
137
}
138
139