This is a kit for making Starsector use OpenJ9.
- Download OpenJ9 from https://developer.ibm.com/languages/java/semeru-runtimes/downloads/. Version 23.0.2.0 was used for this guide but other versions likely work
- Find the path to your Starsector installation location. The default is "C:\Program Files (x86)\Fractal Softworks\Starsector"
- Copy the path to the OpenJ9 zip you downloaded
- Run .\windows_openj9_install.bat "C:\Path\To\Starsector" "C:\Path\To\some-prefix-openj9-some-version.zip"
- Run the game with "Starsector\starsector-core\j9_starsector.bat"
Read the docs for exact details on options https://eclipse.dev/openj9/docs
- XX:+AlwaysPreTouch : Makes the JVM allocate the maximum amount of heap space set by Xmx / Xms. This will likely significantly increases RAM usage, and benchmarking experiments did not indicate performance improvements.
- Xmoi : The amount of memory the heap grows / shrinks by at a time. Likely has little impact on performance.
- Xaggressive : Seems to result in minor performance improvements.
- XtlhPrefetch : Does not seem to improve performance from benchmarking. Windows only.
- Xmint / Xmaxt : Specify the min and max fraction of time to spend on garbage collection. Generally, smaller ranges mean more memory usage and less time spend on GC.
- Xshareclasses : Creates a sort of cache file. Suspected cause of stuttering and does not seem to improve average fps from benchmarking.
- Xmx / Xms : Heap size
- Xmn : Nursery size for gencon (default) GC policy. Larger values result in longer but less frequent garbage collection events. Avoid large values to avoid stuttering.
- Xverbosegclog : Logs garbage collector data into a file. Logs can be viewed with tools like gceasy.io. Long GC times can be the cause of stuttering
- Xjit : Contains logging options for the JIT
- Xaot : Contains logging options for the AOT. j9_starsector.bat disables class sharing so it shouldn't be active.