-
Enhancement
-
Resolution: Unresolved
-
P4
-
25
When including native debugging symbol, the libjvm.a is large. E.g. the libjvm.a release binary for linux-x64 (built from the latest JDK mainline) using gcc is about 1.9GiB:
-rw-r----- 1 jianglizhou primarygroup 2018294094 Feb 13 08:51 libjvm.a
The libjvm.a release binary built using clang is about 508MiB:
-rw-r----- 1 jianglizhou primarygroup 532503946 Feb 14 14:16 libjvm.a
The large binary size can put some strain on storage system.
We explored a few options to reduce the size, including using compression for the debugging sections and using higher zstd compression level. Those techniques helped to reduce the binary size to some extent. We also explored splitting libjvm.a into several smaller static libraries and had good end results. For example, the libjvm.a was split into following:
libepsilon_gc.a libparallel_gc.a libshenandoah_gc.a libz_gc.a
libjvm.a libserial_gc.a
Following are the size info for binary built (a while back) using clang:
-rw-rw-r-- 1 jianglizhou primarygroup 12358666 Feb 10 09:56 libz_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 22989158 Feb 10 09:56 libshenandoah_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 2907252 Feb 10 09:56 libserial_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 5173984 Feb 10 09:56 libparallel_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 356165610 Feb 10 09:56 libjvm.a
-rw-rw-r-- 1 jianglizhou primarygroup 378470 Feb 10 09:56 libepsilon_gc.a
Going with this, it also provide future opportunities for additional optimization. For example, we only need to link with the sub-jvm .a that are need by the application runtime.
-rw-r----- 1 jianglizhou primarygroup 2018294094 Feb 13 08:51 libjvm.a
The libjvm.a release binary built using clang is about 508MiB:
-rw-r----- 1 jianglizhou primarygroup 532503946 Feb 14 14:16 libjvm.a
The large binary size can put some strain on storage system.
We explored a few options to reduce the size, including using compression for the debugging sections and using higher zstd compression level. Those techniques helped to reduce the binary size to some extent. We also explored splitting libjvm.a into several smaller static libraries and had good end results. For example, the libjvm.a was split into following:
libepsilon_gc.a libparallel_gc.a libshenandoah_gc.a libz_gc.a
libjvm.a libserial_gc.a
Following are the size info for binary built (a while back) using clang:
-rw-rw-r-- 1 jianglizhou primarygroup 12358666 Feb 10 09:56 libz_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 22989158 Feb 10 09:56 libshenandoah_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 2907252 Feb 10 09:56 libserial_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 5173984 Feb 10 09:56 libparallel_gc.a
-rw-rw-r-- 1 jianglizhou primarygroup 356165610 Feb 10 09:56 libjvm.a
-rw-rw-r-- 1 jianglizhou primarygroup 378470 Feb 10 09:56 libepsilon_gc.a
Going with this, it also provide future opportunities for additional optimization. For example, we only need to link with the sub-jvm .a that are need by the application runtime.