This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree 1 file changed +4
-4
lines changed
src/java.base/linux/classes/jdk/internal/platform/cgroupv1
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -474,14 +474,14 @@ public long getTcpMemoryUsage() {
474
474
}
475
475
476
476
public long getMemoryAndSwapFailCount () {
477
- if (!memory .isSwapEnabled ()) {
477
+ if (memory != null && !memory .isSwapEnabled ()) {
478
478
return getMemoryFailCount ();
479
479
}
480
480
return SubSystem .getLongValue (memory , "memory.memsw.failcnt" );
481
481
}
482
482
483
483
public long getMemoryAndSwapLimit () {
484
- if (!memory .isSwapEnabled ()) {
484
+ if (memory != null && !memory .isSwapEnabled ()) {
485
485
return getMemoryLimit ();
486
486
}
487
487
long retval = SubSystem .getLongValue (memory , "memory.memsw.limit_in_bytes" );
@@ -500,14 +500,14 @@ public long getMemoryAndSwapLimit() {
500
500
}
501
501
502
502
public long getMemoryAndSwapMaxUsage () {
503
- if (!memory .isSwapEnabled ()) {
503
+ if (memory != null && !memory .isSwapEnabled ()) {
504
504
return getMemoryMaxUsage ();
505
505
}
506
506
return SubSystem .getLongValue (memory , "memory.memsw.max_usage_in_bytes" );
507
507
}
508
508
509
509
public long getMemoryAndSwapUsage () {
510
- if (!memory .isSwapEnabled ()) {
510
+ if (memory != null && !memory .isSwapEnabled ()) {
511
511
return getMemoryUsage ();
512
512
}
513
513
return SubSystem .getLongValue (memory , "memory.memsw.usage_in_bytes" );
You can’t perform that action at this time.
0 commit comments