MaxDirectMemorySize is used to set property sun.nio.MaxDirectMemorySize. In the end, the value is parsed into a Java long. The upper bound of the flag is max_size_t, which can not be represented as Java long properly.
bin/java -XX:MaxDirectMemorySize=18446744073709551615
Error occurred during initialization of VM
java.lang.NumberFormatException: For input string: "18446744073709551615"
at java.lang.NumberFormatException.forInputString(java.base/NumberFormatException.java:65)
at java.lang.Long.parseLong(java.base/Long.java:747)
at java.lang.Long.parseLong(java.base/Long.java:872)
at jdk.internal.misc.VM.saveAndRemoveProperties(java.base/VM.java:290)
at java.lang.System.initPhase1(java.base/System.java:1865)
bin/java -XX:MaxDirectMemorySize=18446744073709551615
Error occurred during initialization of VM
java.lang.NumberFormatException: For input string: "18446744073709551615"
at java.lang.NumberFormatException.forInputString(java.base/NumberFormatException.java:65)
at java.lang.Long.parseLong(java.base/Long.java:747)
at java.lang.Long.parseLong(java.base/Long.java:872)
at jdk.internal.misc.VM.saveAndRemoveProperties(java.base/VM.java:290)
at java.lang.System.initPhase1(java.base/System.java:1865)