ARROW-17604: [Docs][Java] Make it more obvious that --add-opens is required#14066
ARROW-17604: [Docs][Java] Make it more obvious that --add-opens is required#14066lidavidm merged 1 commit intoapache:masterfrom
Conversation
java/memory/memory-core/pom.xml
Outdated
There was a problem hiding this comment.
This may only apply from Java 16+/JEP396: https://openjdk.org/jeps/396
|
JEP 424 may improve this: https://openjdk.org/jeps/424 The new API lets us optionally use the garbage collector for managing memory:
…while still offering precise control:
This is very similar to our concept of a BufferAllocator. JEP 424 would also let us implement the C Data Interface without JNI:
In the very long term, it feels like it could replace much of the implementation of the memory module. In the near term, it may let us provide an allocator implementation that does not require JVM flags on sufficiently recent versions of Java, if we can figure out how to abstract between There are a few important caveats:
So my conclusion is that JEP 424 will eventually be useful, but we will always be dependent on setting special JVM flags that are not normally needed, and so it is not a fundamental user experience improvement. |
61edcc7 to
c73a3b9
Compare
|
@github-actions crossbow submit java |
|
Revision: c73a3b9887bfed342941b5f35a51fb79b8e667de Submitted crossbow builds: ursacomputing/crossbow @ actions-963cb1f0ad |
c73a3b9 to
3b43c9e
Compare
| </goals> | ||
| <configuration> | ||
| <!-- Dummy value to stop inheriting the default add-opens flag --> | ||
| <argLine>-Dfoo=bar</argLine> |
There was a problem hiding this comment.
I could suggest that this line add more arg configuration instead of reset inheriting .values...
There was a problem hiding this comment.
I mean parent project configure maven-surefire-plugin to add <argLine>--add-opens=java.base/java.nio=ALL-UNNAMED</argLine>, if the plan is to TestOpens.java fail will be needed to reset Surefire parent configuration
When you run the TestOpens test it's throw the exception?
| <id>opens-tests</id> | ||
| <!-- Run tests WITHOUT add-opens to make sure we fail-fast --> | ||
| <activation> | ||
| <jdk>[16,]</jdk> |
There was a problem hiding this comment.
Trying to get the TestOpens exception with JRE18 but if finished without that error, Is there some additional configuration needed? Probably mvn -Dtest="TestOpens" clean test not thrown that exception because for test this inherit parent configuration.
[ERROR] Failures:
[ERROR] TestOpens.testMemoryUtilFailsLoudly:32 Expected java.lang.Throwable to be thrown, but nothing was thrown.
There was a problem hiding this comment.
It works with just mvn test. I presume specifying the test name manually is causing it to bypass this configuration.
There was a problem hiding this comment.
Thank you, that was the case
|
Benchmark runs are scheduled for baseline = 5256e43 and contender = 0310add. 0310add is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
…quired (apache#14066) - Improve docs about this - Improve error message about this ``` java.lang.RuntimeException: Failed to initialize MemoryUtil. Was Java started with `--add-opens=java.base/java.nio=ALL-UNNAMED`? (See https://arrow.apache.org/docs/java/install.html) at org.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:138) at org.apache.arrow.memory.DefaultAllocationManagerFactory.<clinit>(DefaultAllocationManagerFactory.java:31) ``` Authored-by: David Li <li.davidm96@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
…quired (apache#14066) - Improve docs about this - Improve error message about this ``` java.lang.RuntimeException: Failed to initialize MemoryUtil. Was Java started with `--add-opens=java.base/java.nio=ALL-UNNAMED`? (See https://arrow.apache.org/docs/java/install.html) at org.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:138) at org.apache.arrow.memory.DefaultAllocationManagerFactory.<clinit>(DefaultAllocationManagerFactory.java:31) ``` Authored-by: David Li <li.davidm96@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
Improve docs about this
Improve error message about this