Hi, Bug: https://bugs.openjdk.java.net/browse/JDK-8248910 Webrev: http://cr.openjdk.java.net/~fyang/8248910/webrev.00/
The overall procedure is described by the newly add test. For a slice from a ByteBuffer, it does not have a cleaner, which leads to the NPE. Here, I thinks we should not try to free the memory of a slice. Proposed fix adds a null check for cleaner in Util.free before invoking its clean() method. Another possible way would be catching slice in Util. releaseTemporaryDirectBuffer and exclude it. Tier1-3 tested on x86_64-linux-gnu. Newly add test fail without the fix and pass otherwise. Comments? Thanks, Felix