Skip to content
Permalink
Browse files
8257746: Regression introduced with JDK-8250984 - memory might be nul…
…l in some machines

Backport-of: abc4300de9c7a298c359fb585d3b0570a98df5cb
  • Loading branch information
Ekaterina Vergizova committed May 13, 2021
1 parent 22d0aab commit 0be19d285688c5c39f7535c0af5332fb7c672079
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java
@@ -439,14 +439,14 @@ public long getTcpMemoryUsage() {
}

public long getMemoryAndSwapFailCount() {
if (!memory.isSwapEnabled()) {
if (memory != null && !memory.isSwapEnabled()) {
return getMemoryFailCount();
}
return getLongValue(memory, "memory.memsw.failcnt");
}

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

public long getMemoryAndSwapMaxUsage() {
if (!memory.isSwapEnabled()) {
if (memory != null && !memory.isSwapEnabled()) {
return getMemoryMaxUsage();
}
return getLongValue(memory, "memory.memsw.max_usage_in_bytes");
}

public long getMemoryAndSwapUsage() {
if (!memory.isSwapEnabled()) {
if (memory != null && !memory.isSwapEnabled()) {
return getMemoryUsage();
}
return getLongValue(memory, "memory.memsw.usage_in_bytes");

1 comment on commit 0be19d2

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 0be19d2 May 13, 2021

Please sign in to comment.