Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Recommended Java Settings

Fedora 6 requires Java 11. The following Java HotSpot VM Options are recommended for running Fedora 46:

No Format
-Djava.awt.headless=true -Dfile.encoding=UTF-8 -serverXms1G -Xms1024m -Xmx4096m -XX:MaxMetaspaceSize=1024mXmx2G -XX:+UseG1GC -XX:+DisableExplicitGC

For Linux JVMs, see:  httphttps://docs.oracle.com/javaseen/8java/docsjavase/technotes11/tools/unix/java.html

-Djava.awt.headless=true
  • Headless mode is a system configuration in which the display device, keyboard, or mouse is lacking. Sounds unexpected, but actually you can perform different operations in this mode, even with graphic data.
-server

...

-

...

-Dfile.encoding=UTF-8  
  • Tell the JVM to use UTF-8 as an encoding for text files to be more platform independent
-

...

Xms1G
  • Set the initial Java Heap memory size to 1024 Megabytes1 Gigabyte
-

...

Xmx2G
  • Set the maximal Java Heap memory size to 4096 Megabytes2 Gigabytes
-XX:

...

  • Set the maximum size of native memory that can be allocated for class metadata to 1024 Megabytes. This is especially recommended when redeploying Fedora 4 often, since otherwise OutOfMemory errors will occur.
-XX:+UseG1GC
  • Enables the use of the garbage-first (G1) garbage collector. It is a server-style garbage collector, targeted for multiprocessor machines with a large amount of RAM. It meets GC pause time goals with high probability, while maintaining good throughput. The G1 collector is recommended for applications requiring large heaps (sizes of around 6 GB or larger) with limited GC latency requirements (stable and predictable pause time below 0.5 seconds).

...

  •  Disable calls to System.gc(), JVM still performs garbage collection when necessary.

Other considerations

-XX:MaxMetaspaceSize=1G
  • If you expect to be redeploying the Fedora instance often, supplying this setting is helpful to prevent OutOfMemory errors. It sets the maximum size of native memory that can be allocated for class metadata to 1 Gigabyte.
-XX:MaxNewSize=1G
  • Set the maximal amount of memory which will be allowed for the young generation of objects in memory to 1 Gigabyte. Increasing this value will decrease the frequency of minor garbage collections, but increase the frequency of major.