-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
The native-image tool has a mode that leaves the Java HotSpot VM performing the image build alive after an image build. Subsequent image builds can reuse that VM, which is then already warmed up and therefore subsequent image builds are faster.
Currently, the build server is enabled by default, and can be disabled using the option --no-server. We propose to flip the default, so that enabling the server requires an opt-in using --experimental-build-server.
While the build server has its uses, it is unfortunately not production quality at this point. We encounter bugs regularly where static state, especially in the JDK, survives from one build to another, leading to strange and hard-to-debug build errors (or even worse, runtime errors of the generated image). For example, #2554 is such a bug that is currently open. Fixing all the issues in a principled manner requires a level of isolation of the JDK that the image generator currently cannot provide: ideally, each image would get its own non-initialized copy of the JDK.
Several frameworks that support Native Image (Spring, Quarkus, Micronaut) already disable the build server by default or encourage users to disable it.
Alternatives:
- Leave the build server enabled by default, invest constantly in fixing occurring issues, but accepting that new issues cannot be avoided.
- Remove the code for the image builder completely: At this point, this seems unnecessary.
If anyone has comments or a preference, please comment on this issue.