Skip to content

Commit

Permalink
8257746: Regression introduced with JDK-8250984 - memory might be nul…
Browse files Browse the repository at this point in the history
…l in some machines

Reviewed-by: hseigel
  • Loading branch information
Poonam Bajaj committed Jan 28, 2021
1 parent 13ca433 commit abc4300
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -444,14 +444,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");
Expand All @@ -469,14 +469,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");
Expand Down

0 comments on commit abc4300

Please sign in to comment.