Replies: 5 comments 2 replies
-
If you can prepare a reproducer I would be curious to have a look at it. |
Beta Was this translation helpful? Give feedback.
-
Same project mentioned in this thread: #23181 And
|
Beta Was this translation helpful? Give feedback.
-
Tested removing some artifacts and liquibase was 35MB of the binary 😮 I'm left with resteasy reactive and Kotlin at about 50MB for the smallest useful native binary for me. |
Beta Was this translation helpful? Give feedback.
-
Hi, I just had a look and was about to suggest the same... some extensions are more optimised than others. The Liquibase module in particular is IMO something more useful during development and isn't necessarily something I'd recommend including into the production binary. When you look at removing individual extensions, it's hard to say - for example - if Micrometer is consuming 1.5MB or if that's rather its impact when combined with the particular other exctensions. GraalVM can be very effective at removing large chunks of dead code, including significant portions of the JDK, but it will only do so when it can safely proof that such code isn't being used by any code in the application at all. So for example if both OIDC and PosgreSQL use a particular cryptographic cypher "X" which consumes 5MB (just making up an example, but the cyphers are in fact sometimes rather large), you'd only save those 5MB if you removed both OIDC and PosgreSQL. And the same approach works at the finest level, to the symbol. Many Quarkus extensions include optimisations to help guide the GraalVM compiler into removing such dead code, helping identify specific methods which are dead in one particular application; sometimes such optimisations are missing or more rudimentary, which might lead to situations like the Hibernate ORM extension to be relatively small compared to say Liquibase (I've spent months on the first, but not spent much time at all on Liquibase). As a general note, remember that while the ~137 MB might seem rather large, it doesn't include just your code but also all libraries and the whole JDK and the JVM. It's not small and we're still improving on that (I just got ~130 MB locally testing your demo but I'm running a development build of GraalVM from today), but hopefully it helps putting things in perspective if you compare it with the whole JVM + app and dependenciesyou'd normally have. The GraalVM project also offers some additional tooling to help figure out what is consuming space in your binary. Version 22.0 prints some nice reports by default. |
Beta Was this translation helpful? Give feedback.
-
Thanks Sanne...that's fair. Was just surprised that I've seen live coding demos and blogs creating native images that are only 40MB and didn't expect mine to be that much bigger :-) |
Beta Was this translation helpful? Give feedback.
-
I thought I had a fairly trivial app and it generated a 137MB app for me 😮
It does use reactive resteasy and panache and hibernate and oidc and openapi, so it's a fairly typical microservice....
Is there a list of native app size binary blob sizes for each extension? Curious how big each of the things I added contributes to the binary size...
Beta Was this translation helpful? Give feedback.
All reactions