Choosing your JVM and properly configuring it


This one has become easy by now:

With the advent of GraalVM 19.3.0 for any need there is a Java runtime compatible with Java 11 that you really should use. Any distro / OS will have a ready-made install available that does not require further tweaking. Now we also have the G1 garbage collector standard everywhere.

Be sure include the following optimizations in wrapper.config:

wrapper.java.additional.**=-XX:+UseG1GC # default, not really necessary
wrapper.java.additional.
**=-XX:G1ConcRefinementThreads=1 # for 8+ cores, i2p does not need more
wrapper.java.additional.
**=-XX:ConcGCThreads=1 # for 8+ cores, i2p does not need more

32-bit VMs are more memory efficient and best choice for i2p, but most of you guys will run 64 bit, so enable the Graal JIT compiler using:

wrapper.java.additional.
**=-XX:+UnlockExperimentalVMOptions
wrapper.java.additional.
**=-XX:+UseJVMCICompiler # noop if using Graal

In terms of speed there should be no big difference between 32 bit with the default C2 JIT compiler and 64 bit using Graal JIT.

<-- Back