-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8345942: Separate source output from class output when building microbenchmarks #22731
Conversation
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
@lahodaj This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 96 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
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 looks good. I think this is similar to how standard Maven-based JMH build works as well: it puts the generated sources into target/generated-sources
, separate from the original sources.
/integrate |
Going to push as commit 99af595.
Your commit was automatically rebased without conflicts. |
The microbenchmarks build generates a considerable amount of (generated) sources using an annotation processor. This, by itself, is not a problem. But, it generates them into the class output, and after the microbenchmarks build has been updated to be (somewhat) incremental, the class output has been added to the classpath(*):
b704bfa
Then when the AP attempts to generate a new file (for a class name), javac will look for same-named classes on the classpath, and may load the source code generated by a previous rounds of builds, in case of an incremental build. And since the AP generates the considerable amount of these files, this leads to loading a considerable amounts of source code, eventually leading to memory problems (JDK-8345302).
The proposal herein is to split the (generated) source output from the class output. This considerably reduces the amount of memory javac uses, and generally seems like a good approach for the build.
(*) adding the class output to the classpath is usually needed when incrementally compiling code in the unnamed module, to ensure that if e.g. only one source file is being compiled, it can refer to other, already produced, classes. As a side note, this does not need to be done in named-module compilation modes, as javac automatically reads the class output when compiling the named modules. But it is not easily possible to enhance javac to do that for unnamed module, due to compatibility concerns.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22731/head:pull/22731
$ git checkout pull/22731
Update a local copy of the PR:
$ git checkout pull/22731
$ git pull https://git.openjdk.org/jdk.git pull/22731/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22731
View PR using the GUI difftool:
$ git pr show -t 22731
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22731.diff
Using Webrev
Link to Webrev Comment