Path: blob/master/src/java.base/linux/classes/jdk/internal/platform/CgroupV1Metrics.java
40948 views
/*1* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package jdk.internal.platform;2627/**28*29* Cgroup v1 extensions to the Metrics interface. Linux, only.30*31*/32public interface CgroupV1Metrics extends Metrics {3334/**35* Returns the largest amount of physical memory, in bytes, that36* have been allocated in the Isolation Group.37*38* @return The largest amount of memory in bytes or -1 if this39* metric is not available. Returns -2 if this metric is not40* supported.41*42*/43public long getMemoryMaxUsage();4445/**46* Returns the number of times that kernel memory requests in the47* Isolation Group have exceeded the kernel memory limit.48*49* @return The number of exceeded requests or -1 if metric50* is not available.51*52*/53public long getKernelMemoryFailCount();5455/**56* Returns the maximum amount of kernel physical memory, in bytes, that57* can be allocated in the Isolation Group.58*59* @return The maximum amount of memory in bytes or -1 if60* there is no limit set.61*62*/63public long getKernelMemoryLimit();6465/**66* Returns the largest amount of kernel physical memory, in bytes, that67* have been allocated in the Isolation Group.68*69* @return The largest amount of memory in bytes or -1 if this70* metric is not available.71*72*/73public long getKernelMemoryMaxUsage();7475/**76* Returns the amount of kernel physical memory, in bytes, that77* is currently allocated in the current Isolation Group.78*79* @return The amount of memory in bytes allocated or -1 if this80* metric is not available.81*82*/83public long getKernelMemoryUsage();8485/**86* Returns the number of times that networking memory requests in the87* Isolation Group have exceeded the kernel memory limit.88*89* @return The number of exceeded requests or -1 if the metric90* is not available.91*92*/93public long getTcpMemoryFailCount();9495/**96* Returns the maximum amount of networking physical memory, in bytes,97* that can be allocated in the Isolation Group.98*99* @return The maximum amount of memory in bytes or -1 if100* there is no limit.101*102*/103public long getTcpMemoryLimit();104105/**106* Returns the largest amount of networking physical memory, in bytes,107* that have been allocated in the Isolation Group.108*109* @return The largest amount of memory in bytes or -1 if this110* metric is not available.111*112*/113public long getTcpMemoryMaxUsage();114115/**116* Returns the number of times that user memory requests in the117* Isolation Group have exceeded the memory + swap limit.118*119* @return The number of exceeded requests or -1 if the metric120* is not available.121*122*/123public long getMemoryAndSwapFailCount();124125/**126* Returns the largest amount of physical memory and swap space,127* in bytes, that have been allocated in the Isolation Group.128*129* @return The largest amount of memory in bytes or -1 if this130* metric is not available.131*132*/133public long getMemoryAndSwapMaxUsage();134135/**136* Returns the state of the Operating System Out of Memory termination137* policy.138*139* @return Returns true if operating system will terminate processes140* in the Isolation Group that exceed the amount of available141* memory, otherwise false. null will be returned if this142* capability is not available on the current operating system.143*144*/145public Boolean isMemoryOOMKillEnabled();146147/**148* Returns the (attempts per second * 1000), if enabled, that the149* operating system tries to satisfy a memory request for any150* process in the current Isolation Group when no free memory is151* readily available. Use {@link #isCpuSetMemoryPressureEnabled()} to152* determine if this support is enabled.153*154* @return Memory pressure or 0 if not enabled or -1 if metric is not155* available.156*157*/158public double getCpuSetMemoryPressure();159160/**161* Returns the state of the memory pressure detection support.162*163* @return true if support is available and enabled. false otherwise.164*165*/166public Boolean isCpuSetMemoryPressureEnabled();167}168169170