--- old/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java 2020-01-09 20:39:14.707140901 +0100 +++ new/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java 2020-01-09 20:39:14.571140759 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ 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; @@ -283,7 +284,7 @@ public long[] getPerCpuUsage() { String usagelist = CgroupSubsystemController.getStringValue(cpuacct, "cpuacct.usage_percpu"); if (usagelist == null) { - return new long[0]; + return null; } String list[] = usagelist.split(" "); @@ -319,7 +320,7 @@ public long getCpuShares() { long retval = getLongValue(cpu, "cpu.shares"); if (retval == 0 || retval == 1024) - return -1; + return Metrics.LONG_RETVAL_UNLIMITED; else return retval; } @@ -365,7 +366,7 @@ return CgroupSubsystemController.getDoubleValue(cpuset, "cpuset.memory_pressure"); } - public boolean isCpuSetMemoryPressureEnabled() { + public Boolean isCpuSetMemoryPressureEnabled() { long val = getLongValue(cpuset, "cpuset.memory_pressure_enabled"); return (val == 1); } @@ -473,7 +474,7 @@ 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); }