https://kotlinlang.org logo
#ktor
Title
# ktor
z

Zjm

02/24/2024, 2:10 AM
Hi, I'm trying to understand the difference between Fat JAR (https://ktor.io/docs/fatjar.html) and Application Distribution (https://ktor.io/docs/gradle-application-plugin.html) for deployment. Based on my understanding, the Application Distribution will bundled and used JRE but only the part that is actually needed, is that correct? I'm wondering, will it improve resource usage especially memory compared to fat jar that need the whole JRE installed? or it's just for convenience (no need to install JRE separately)
a

Andreas Scheja

02/24/2024, 5:44 AM
To my knowledge there is no real advantage of either way regarding resource usage as both variants depend on an externally provided JRE. What you meant with shipping only parts of the JRE with your application requires the use of jlink. IMO the main advantage of the application-plugin over the fatjar is that if you only changed your code you don't have to deploy all your dependencies again as they are kept in their individual jar files.
z

Zjm

02/24/2024, 9:10 AM
What you meant with shipping only parts of the JRE with your application requires the use of jlink.
Ah I see, does using jlink is integrated in ktor gradle plugin? is there a guide to use it on ktor deployment?
I found the guide for compose multiplatform project but not for ktor, do I have to use separate gradle plugin ?
5 Views