-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
removal of --enable-all-security-services adds 10 mb extra classes #3422
Comments
if we could at all have a way to disable the now default "--enable-all-security-services", i.e. "--no-enable-all-security-services" would be great. |
@vjovanov @christianwimmer Can we assess in collaboration with the Quarkus team why the automatic detection is adding those security services for the Quarkus "hello world"? |
@cstancu please have a look if there is anything obvious that should not be included. Also would be good to have a tracing flag that prints why a certain security service is included. |
@maxandersen also one thing that Quarkus can try: The image generator uses the security services configured at image build time and puts the reachable ones into the image. But if you know that you do not need a security provider at all, you can already remove that provider for the image generator. Then it is guaranteed that this provider is not included into the image. |
Although not the same helloworld app as what Max used, here's a github repo https://github.com/jaikiran/graal-3422-reproducer which has a simple Quarkus app (which just uses JAXRS RestEasy extension). The I ran it against I see a lot of additional classes added for reflection and bunch of crypto classes marked as used. [1] https://github.com/jaikiran/graal-3422-reproducer/blob/master/README.md |
I see a 3MB increase when upgrading babashka to 21.1.0. The diff shows that classes from used_classes_bb_20210522_140854_21.0.0.txt |
Our assumption is that graalvm notices classes in vertx that refer to security but we know from quarkus build time is not needed. |
a38cba8 refactors the automatic registration of security services. Using Disabling the automatic registration of security services means that a custom reflection registration must be provided, depending on which security services the application uses. See the updated Looking at the Quarkus Regarding the increase in size: out of the 10Mb only about 5Mb are due to the security services. The rest can be accounted for by the various improvements in compatibility, e.g., improved suport for This PR also improves tracing, enabled via
The |
Describe the issue
in #3258
--enable-all-security-services
was removed and now a whole slew of additional security classes and ciphers are added that was not added before. This causes the image size for a Quarkus app to have at least 10 mb of additional content which is not necessary.Here are the diff between helloworlds with zero changes, only diff is using graalvm 21.0 vs 21.1:
I believe in Graalvm 21.1 was added some mecahnics to try and detct if security was being used and if yes add all security services. That is a nice feature but we find that it is adding more than it need to.
Opening this issue to discuss options on avoiding this.
other info:
21.0 gives 5768 classes vs. 7488 classes in 21.1 so its quite an increase with no functional gain.
The text was updated successfully, but these errors were encountered: