mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8257746: Regression introduced with JDK-8250984 - memory might be null in some machines
Reviewed-by: hseigel
This commit is contained in:
parent
13ca433ff6
commit
abc4300de9
1 changed files with 4 additions and 4 deletions
|
@ -444,14 +444,14 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics {
|
|||
}
|
||||
|
||||
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");
|
||||
|
@ -469,14 +469,14 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics {
|
|||
}
|
||||
|
||||
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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue