Modular LIBJVM.SO library for Docker

David Holmes david.holmes at oracle.com
Tue May 25 00:56:44 UTC 2021


Hi Tibor,

On 25/05/2021 5:26 am, Tibor Digana wrote:
> Hi,
> 
> The size of the library "libjvm.so"o is bigger than Java modules, and
> bigger or comparable with the size of the application in the Docker image.
> 
> After processing the JDK by the JLINK and shrinking the native library "
> libjvm.so" my JRE is 35MB big in Docker image but the "libjvm.so" is too
> big, i.e. 18MB (from the original size 22MB) and the modules have only 12MB.
> 
> We have many GC algorithms in the JVM and maybe this is the reason why the
> library is bigger than the Java modules and then JLINK does not become much
> effective.

I'm not sure why you think the JVM should be comparable in size to the 
native code used by the core libraries. The JVM is a huge piece of 
native code in comparison to that used by the core libraries.

> Can you please develop a modular JVM library so that I would be able to
> select only one algorithm of GC which means that the modules with other GC
> algorithms would not appear in my Docker image?

This can be built today (modulo some possible issues Stefan mentioned). 
You need to find an OpenJDK provider/distributor who is prepared to take 
on the cost of providing a selection of binaries with different VM 
features enabled.

I've no idea how much size might be saved by stripping out different 
GC's today.

Cheers,
David

> Thx
> Tibor
> 


More information about the hotspot-dev mailing list