jmods-less jlinking prototype
Alan Bateman
Alan.Bateman at oracle.com
Fri Mar 17 09:34:29 UTC 2023
On 15/03/2023 16:57, Severin Gehwolf wrote:
> :
> I'd argue that the case where users actually want things back (add
> back, rather than remove) from any base JDK image is rather small.
> Though, I have no numbers about this so this is only anecdotal. Have
> you seen use-cases doing that (add-back, taking from jmods)?
Almost every usage that I've observed has been reduction and one jlink
step to create a small run-time image. It's always start with a JDK
build with packaged modules and then jlink to generate a run-time image
with the subset of the standard and JDK modules that the application
needs. Some sightings have included jlink options to compress or strip
debug attributes, just to get the size down. I haven't seen any usages
of --keep-packaged-modules so the resulting run-time couldn't be used to
stamp out another run-time image, at least not without specifying
-module-path and of course including the jdk.jlink module.
The only of additive case that I've come across is with the GraalVM
build where they use the jlink --add-option to add VM options to select
the Graal JIT. This works by adding a resource to the java.base module.
More recently, --save-jlink-argfiles has been added so the options are
preserved for future stamping of out of images. I haven't seen any
usages of this yet but it would need to be paired with
--keep-packaged-modules to be useful. Your prototype avoid needing that
of course.
-Alan
More information about the leyden-dev
mailing list