javac --add-exports java.base/jdk.internal.misc=ALL-UNNAMED Main.java
java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -cp . Main
maxDirectMemory
defaults to default max memory
maxDirectMemory
defaults to Xmx in this case
java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -cp . -Xmx200m Main
sun.misc.VM.maxDirectMemory(): 209715200
java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -cp . -Xmx200m -XX:MaxDirectMemorySize=60m Main
sun.misc.VM.maxDirectMemory(): 62914560
MaxDirectMemorySize
takes precedence in this case