A DESCRIPTION OF THE PROBLEM :
I have read JDK-6535542 comment, and know zero-initialized is for security reason.
I suggest modify code at java.nio.DirectByteBuffer line 129
from:
UNSAFE.setMemory(base, size, (byte) 0);
to
UNSAFE.setMemory(address, cap, (byte) 0);
The different is when DirectMemoryPageAligned is set, address is the start of the page, this would not touch the unused part, and it will also be zero-initialized.
As O_DIRECT is supported from java 11, I think this problem is worth to considered.