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 @@ -439,14 +439,14 @@ public long getTcpMemoryUsage() {
439
439
}
440
440
441
441
public long getMemoryAndSwapFailCount () {
442
- if (!memory .isSwapEnabled ()) {
442
+ if (memory != null && !memory .isSwapEnabled ()) {
443
443
return getMemoryFailCount ();
444
444
}
445
445
return getLongValue (memory , "memory.memsw.failcnt" );
446
446
}
447
447
448
448
public long getMemoryAndSwapLimit () {
449
- if (!memory .isSwapEnabled ()) {
449
+ if (memory != null && !memory .isSwapEnabled ()) {
450
450
return getMemoryLimit ();
451
451
}
452
452
long retval = getLongValue (memory , "memory.memsw.limit_in_bytes" );
@@ -464,14 +464,14 @@ public long getMemoryAndSwapLimit() {
464
464
}
465
465
466
466
public long getMemoryAndSwapMaxUsage () {
467
- if (!memory .isSwapEnabled ()) {
467
+ if (memory != null && !memory .isSwapEnabled ()) {
468
468
return getMemoryMaxUsage ();
469
469
}
470
470
return getLongValue (memory , "memory.memsw.max_usage_in_bytes" );
471
471
}
472
472
473
473
public long getMemoryAndSwapUsage () {
474
- if (!memory .isSwapEnabled ()) {
474
+ if (memory != null && !memory .isSwapEnabled ()) {
475
475
return getMemoryUsage ();
476
476
}
477
477
return getLongValue (memory , "memory.memsw.usage_in_bytes" );
You can’t perform that action at this time.
0 commit comments