Integrated: 8257746: Regression introduced with JDK-8250984 - memory might be null in some machines

Poonam Bajaj poonam at openjdk.java.net
Thu Jan 28 15:10:43 UTC 2021


On Wed, 27 Jan 2021 21:10:16 GMT, Poonam Bajaj <poonam at openjdk.org> wrote:

> Please review this simple change that adds null checks for memory in CgroupV1Subsystem.java.
> 
> Problem: After the backport of JDK-8250984,  there are places where memory.isSwapEnabled() is called. For example:
> 
>     public long getMemoryAndSwapFailCount() {
>         if (!memory.isSwapEnabled()) {
>             return getMemoryFailCount();
>         }
>         return SubSystem.getLongValue(memory, "memory.memsw.failcnt");
>     }
>  
> But memory could be Null on some machines that have cgroup entries for CPU but not for memory. This would cause a NullPointerException when memory is accessed.
> 
> Fix: Add null checks for memory.

This pull request has now been integrated.

Changeset: abc4300d
Author:    Poonam Bajaj <poonam at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/abc4300d
Stats:     4 lines in 1 file changed: 0 ins; 0 del; 4 mod

8257746: Regression introduced with JDK-8250984 - memory might be null in some machines

Reviewed-by: hseigel

-------------

PR: https://git.openjdk.java.net/jdk/pull/2269


More information about the core-libs-dev mailing list