Comment by nkzd

4 hours ago

Which JVM options do you use the most?

Heap size, GC algorithm.

I suggest most people never touch almost any other options. (Flight recording and heap dumps being the exception).

  • GC threads are generally often useful on multi-tenant systems or machines with many cores, as Java will default-size its thread pools according to the number of logical cores. If the server has 16 or more cores, that's very rarely something you want, especially if you run multiple JVMs on the same host.

    Not JVM options, but these are often also good to tune:

        -Djdk.virtualThreadScheduler.parallelism
        -Djdk.virtualThreadScheduler.maxPoolSize
        -Djava.util.concurrent.ForkJoinPool.common.parallelism
    

    In my experience this often both saves memory and improves performance.