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

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: sgehwolf
Backport-of: abc4300
  • Loading branch information
Ekaterina Vergizova committed Mar 2, 2021
1 parent a3174be commit c668a0c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,14 @@ public long getTcpMemoryUsage() {
}

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

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

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

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

1 comment on commit c668a0c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.