bloop icon indicating copy to clipboard operation
bloop copied to clipboard

Avoid hardcoded `-XX:+UseZGC` on BSD system?

Open catap opened this issue 1 year ago • 1 comments

Unfortently, OpenJDK does'n support ZGC on BSD system, an attempt to enable it on cofigure fails as:

checking if platform is supported by ZGC... no, bsd-x86_64
checking if JVM feature 'zgc' is available... no

See: https://github.com/openjdk/jdk/blob/027607968b3d55b498e9f2d7a4023b8ae2d47b5b/make/autoconf/jvm-features.m4#L318-L327

This mean that attempt to use bloop on any bsd system fails as:

~ $ scala --power bloop output
Error occurred during initialization of VM
Option -XX:+UseZGC not supported
~ $ 

as temporarry workaround a user may do something like this:

env BLOOP_JAVA_OPTS="-XX:+UseParallelGC"  scala --power bloop output

but, I think, that default hardcoded option should be adjusted.

And yes, ShenandoahGC is available on BSD system if you think that low latency GC is requried here.

catap avatar Nov 25 '24 22:11 catap

Thanks for reporting! It should be easy to check the current platform and change the defaults at https://github.com/scalacenter/bloop/blob/7bac89a5a7c5098909a6fc489fe099766a2dd00d/bloop-rifle/src/main/scala/bloop/rifle/BloopRifleConfig.scala#L75

I might not have time to fix it soon though.

tgodzik avatar Nov 26 '24 16:11 tgodzik