JDK-8027231 : Remove -XX:+PageAlignDirectMemory reference in the Enhancements in Java I/O doc
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 7,7u25
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2013-08-16
  • Updated: 2014-01-16
  • Resolved: 2013-11-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7u51 b10Fixed
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version  " 1.7.0_25 " 
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)


FULL OS VERSION :
Linux pierohd111.ds.redbeemedia.net 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
According to:
http://docs.oracle.com/javase/7/docs/technotes/guides/io/enhancements.html
the Java 7 runtime should accept the option -XX:+PageAlignDirectMemory. This should revert the behaviour for allocating  " direct "  ByteBuffers (using ByteBuffer.allocateDirect()) so that the allocated memory is aligned to page boundary.

Instead, when you run the command:

java -XX:+PageAlignDirectMemory

It gives the response:

Unrecognized VM option 'PageAlignDirectMemory'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the command:

java -XX:+PageAlignDirectMemory

It gives the response:

Unrecognized VM option 'PageAlignDirectMemory'

REPRODUCIBILITY :
This bug can be reproduced always.
Comments
Joni - yes, for now then removing any mention of this VM option is fine.
21-11-2013

Please confirm, http://docs.oracle.com/javase/7/docs/technotes/guides/io/enhancements.html needs to be updated to remove the reference to PageAlignDirectMemory and there is no other option that replaces it. So essentially, the sentence "Applications that previously relied on the undocumented alignment can revert to previous behavior if they are run with the command line option: -XX:+PageAlignDirectMemory." needs to be deleted.
20-11-2013

The system property sun.nio.PageAlignDirectMemory should not be documented as direct use of this internal property is not supported. Instead we just need to look again to see if the PageAlignDirectMemory option is really needed or not (JDK 7 shipped in 2011 and so far we have not had any reports of issues with to the removal of page alignment).
06-11-2013

This flag was never added, documentation should be changed to reference -Dsun.nio.PageAlignDirectMemory=true instead.
05-11-2013

The issue here is that the hotspot part to JDK-4837564 was never pushed. I need to track down the review mail on hotspot-runtime-dev to find the history.
24-10-2013

I can find not reference in the VM code for PageAlignDirectMemory, either in JDK7 or JDK8. It appears that JDK-4837564 was used for the library implementation, and JDK-6992192 ( currently open/unresolved ) for the VM part of the changes. Alan may remember some of the details here.
24-10-2013

It seems this flag has been removed at some point during JDK7. However, it seems that one can instead use -Dsun.nio.PageAlignDirectMemory=true. In any case, references to this flag should be removed from the source. I see it in a comment at jdk/src/share/classes/sun/misc/VM.java, and in pubs/docs/technotes/guides/io/enhancements.html Also, flags should generally not be removed outside of major releases as it can lead to regressions in environments that uses them when upgrading to a newer minor version.
24-10-2013