Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk15u-dev Public archive

Commit 0be19d2

Browse files
author
Ekaterina Vergizova
committed
8257746: Regression introduced with JDK-8250984 - memory might be null in some machines
Backport-of: abc4300de9c7a298c359fb585d3b0570a98df5cb
1 parent 22d0aab commit 0be19d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,14 @@ public long getTcpMemoryUsage() {
439439
}
440440

441441
public long getMemoryAndSwapFailCount() {
442-
if (!memory.isSwapEnabled()) {
442+
if (memory != null && !memory.isSwapEnabled()) {
443443
return getMemoryFailCount();
444444
}
445445
return getLongValue(memory, "memory.memsw.failcnt");
446446
}
447447

448448
public long getMemoryAndSwapLimit() {
449-
if (!memory.isSwapEnabled()) {
449+
if (memory != null && !memory.isSwapEnabled()) {
450450
return getMemoryLimit();
451451
}
452452
long retval = getLongValue(memory, "memory.memsw.limit_in_bytes");
@@ -464,14 +464,14 @@ public long getMemoryAndSwapLimit() {
464464
}
465465

466466
public long getMemoryAndSwapMaxUsage() {
467-
if (!memory.isSwapEnabled()) {
467+
if (memory != null && !memory.isSwapEnabled()) {
468468
return getMemoryMaxUsage();
469469
}
470470
return getLongValue(memory, "memory.memsw.max_usage_in_bytes");
471471
}
472472

473473
public long getMemoryAndSwapUsage() {
474-
if (!memory.isSwapEnabled()) {
474+
if (memory != null && !memory.isSwapEnabled()) {
475475
return getMemoryUsage();
476476
}
477477
return getLongValue(memory, "memory.memsw.usage_in_bytes");

0 commit comments

Comments
 (0)