< prev index next >
src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java
Print this page
@ rev 57446 : Review changes
|
o rev 57445 : 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
| Reviewed-by: bobv
~
o rev 56863 : 8231111: Cgroups v2: Rework Metrics in java.base so as to recognize unified hierarchy
| Reviewed-by: bobv
~
@@ -31,10 +31,11 @@
import java.util.stream.Stream;
import jdk.internal.platform.CgroupSubsystem;
import jdk.internal.platform.CgroupSubsystemController;
import jdk.internal.platform.CgroupUtil;
+import jdk.internal.platform.Metrics;
public class CgroupV1Subsystem implements CgroupSubsystem {
private CgroupV1MemorySubSystemController memory;
private CgroupV1SubsystemController cpu;
private CgroupV1SubsystemController cpuacct;
@@ -317,11 +318,11 @@
}
public long getCpuShares() {
long retval = getLongValue(cpu, "cpu.shares");
if (retval == 0 || retval == 1024)
- return -1;
+ return Metrics.LONG_RETVAL_UNLIMITED;
else
return retval;
}
public long getCpuNumPeriods() {
@@ -363,11 +364,11 @@
public double getCpuSetMemoryPressure() {
return CgroupSubsystemController.getDoubleValue(cpuset, "cpuset.memory_pressure");
}
- public boolean isCpuSetMemoryPressureEnabled() {
+ public Boolean isCpuSetMemoryPressureEnabled() {
long val = getLongValue(cpuset, "cpuset.memory_pressure_enabled");
return (val == 1);
}
@@ -471,11 +472,11 @@
public long getMemoryAndSwapUsage() {
return getLongValue(memory, "memory.memsw.usage_in_bytes");
}
- public boolean isMemoryOOMKillEnabled() {
+ public Boolean isMemoryOOMKillEnabled() {
long val = CgroupSubsystemController.getLongEntry(memory, "memory.oom_control", "oom_kill_disable");
return (val == 0);
}
public long getMemorySoftLimit() {
< prev index next >