-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-17421] [DOCS] Documenting the current treatment of MAVEN_OPTS. #15005
Conversation
@@ -16,24 +16,27 @@ Building Spark using Maven requires Maven 3.3.9 or newer and Java 7+. | |||
|
|||
### Setting up Maven's Memory Usage | |||
|
|||
You'll need to configure Maven to use more memory than usual by setting `MAVEN_OPTS`. We recommend the following settings: | |||
If you are compiling with Java 7, you'll need to configure Maven to use more memory than usual by setting `MAVEN_OPTS`: |
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 is still needed for Java 8, just not MaxPermSize.
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 actually think the ReservedCodeCacheSize advice is defunct. I don't use it and don't have problems. But, maybe not worth worrying about here. It has nothing to do with the warnings discussed in this section though.
Anyway, might I finally suggest that, because Java 8 is more the default now and soon to be required, that this advice basically say:
Add Xmx and XX:ReservedCodeCacheSize to MAVEN_OPTS
Or else you might see this error
If you're on Java 7 by the way, also add this MaxPermSize param like so
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.
Leaving out -XX:ReservedCodeCacheSize
caused a warning in my tests:
OpenJDK 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled. OpenJDK 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
Left that option in and reworded the beginning of this section as you suggested.
Sure, I'll redo that part so that includes two sets of recommended options. Note that docs in the Spark 2.0.0 release say that these options aren't necessary for Java 8. |
|
||
**Note:** | ||
|
||
* For Java 8 and above this step is not required. | ||
* If using `build/mvn` with no `MAVEN_OPTS` set, the script will automate this for you. | ||
* This step is not needed for Java 8. |
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 think this comment is now wrong and can be removed.
Quick update: I'm running a series of test builds with various parameters to determine what parts of MAVEN_OPTS are currently necessary on different versions of Java. Will report back in a few days and update this PR. |
@frreiss are you in a position to finish this one? |
I've about narrowed down the options that work for OpenJDK 7 and 8 on Mac and Linux. Working on IBM Java on Linux. I can have an update in by EOD today. |
Summary of testing:
|
|
||
**Note:** | ||
|
||
* For Java 8 and above this step is not required. | ||
* If using `build/mvn` with no `MAVEN_OPTS` set, the script will automate this for you. | ||
* If using `build/mvn` with no `MAVEN_OPTS` set, the script will automatically add the above options for Java 7 to the `MAVEN_OPTS` environment variable. |
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 actually adds them regardless of the Java version, it seems. Which is fine. The rest looks good. If you get to that change, great, otherwise I can probably safely make the change on merge.
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 I meant to say was that build/mvn adds all three options, but I can see how the statement here can interpreted differently. Checking in an edited version.
Test build #3284 has finished for PR 15005 at commit
|
Test build #3286 has finished for PR 15005 at commit
|
## What changes were proposed in this pull request? Modified the documentation to clarify that `build/mvn` and `pom.xml` always add Java 7-specific parameters to `MAVEN_OPTS`, and that developers can safely ignore warnings about `-XX:MaxPermSize` that may result from compiling or running tests with Java 8. ## How was this patch tested? Rebuilt HTML documentation, made sure that building-spark.html displays correctly in a browser. Author: frreiss <frreiss@us.ibm.com> Closes #15005 from frreiss/fred-17421a. (cherry picked from commit 646f383) Signed-off-by: Sean Owen <sowen@cloudera.com>
Merged to master/2.0 |
Thanks @srowen for all the thoughtful comments! It's great to see committers spending time to help improve the build experience for new developers. |
What changes were proposed in this pull request?
Modified the documentation to clarify that
build/mvn
andpom.xml
always add Java 7-specific parameters toMAVEN_OPTS
, and that developers can safely ignore warnings about-XX:MaxPermSize
that may result from compiling or running tests with Java 8.How was this patch tested?
Rebuilt HTML documentation, made sure that building-spark.html displays correctly in a browser.