-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-17604: [Docs][Java] Make it more obvious that --add-opens is required #14066
Conversation
java/memory/memory-core/pom.xml
Outdated
<id>opens-tests</id> | ||
<!-- Run tests WITHOUT add-opens to make sure we fail-fast --> | ||
<activation> | ||
<jdk>[9,]</jdk> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: c73a3b9 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could suggest that this line add more arg configuration instead of reset inheriting .values...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that was the case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, than you
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 <[email protected]> Signed-off-by: David Li <[email protected]>
…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 <[email protected]> Signed-off-by: David Li <[email protected]>
Improve docs about this
Improve error message about this