On Mon, 24 Feb 2025 12:39:37 GMT, Matthias Baesken <mbaes...@openjdk.org> wrote:

> To be sure, I did a minimal build on Linux x86_64. I set 
> `--with-jvm-features=minimal --with-jvm-variants=minimal` for this.
> This leads to
> `JVM_FEATURES_minimal='compiler1 minimal opt-size serialgc'`
> So no jvmti, to GCs except serialgc . Just C1, no C2. The 'opt-size' flag is 
> set so the libjvm is compiled with size optimization (on Linux -Os). The 
> other native libs (JDK native libs) still use the opt-flags they always use, 
> as I thought.

"minimal" if a very specific footprint reducing build configuration. However, I 
believe what it does is enable a bunch of other individual footprint reduction 
features. For example, even without configuring specifically for minimal, you 
can optionally exclude JVMTI, or extra GCs, or C2, and I think you can 
optionally configure libjvm.so to be built for small size, not performance. 
It's not "all or none", but we don't really encourage (or officially support) 
selectively choosing what to exclude because it is not well tested.

> On the other hand we can achieve good performance and smaller binaries with 
> lto (at least with gcc).

Absence of benchmarking and given the relatively small footprint savings, I 
don't think we should switch to SIZE. LTO seems fine. I don't know of any 
negative impacts with using it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/23563#issuecomment-2680236696

Reply via email to