This repository was archived by the owner on Sep 2, 2022. 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 @@ -444,14 +444,14 @@ public long getTcpMemoryUsage() {
444
444
}
445
445
446
446
public long getMemoryAndSwapFailCount () {
447
- if (!memory .isSwapEnabled ()) {
447
+ if (memory != null && !memory .isSwapEnabled ()) {
448
448
return getMemoryFailCount ();
449
449
}
450
450
return getLongValue (memory , "memory.memsw.failcnt" );
451
451
}
452
452
453
453
public long getMemoryAndSwapLimit () {
454
- if (!memory .isSwapEnabled ()) {
454
+ if (memory != null && !memory .isSwapEnabled ()) {
455
455
return getMemoryLimit ();
456
456
}
457
457
long retval = getLongValue (memory , "memory.memsw.limit_in_bytes" );
@@ -469,14 +469,14 @@ public long getMemoryAndSwapLimit() {
469
469
}
470
470
471
471
public long getMemoryAndSwapMaxUsage () {
472
- if (!memory .isSwapEnabled ()) {
472
+ if (memory != null && !memory .isSwapEnabled ()) {
473
473
return getMemoryMaxUsage ();
474
474
}
475
475
return getLongValue (memory , "memory.memsw.max_usage_in_bytes" );
476
476
}
477
477
478
478
public long getMemoryAndSwapUsage () {
479
- if (!memory .isSwapEnabled ()) {
479
+ if (memory != null && !memory .isSwapEnabled ()) {
480
480
return getMemoryUsage ();
481
481
}
482
482
return getLongValue (memory , "memory.memsw.usage_in_bytes" );
You can’t perform that action at this time.
0 commit comments