Many hours have I spent trying to find a configuration that makes java Minecraft as smooth as the triple-A titles from the store. My hardware is capable, but for some reason Minecraft runs like ass no matter what I do.
Finally I have found a configuration that seems to work for me. I use a version of Java 17 by the Eclipse Foundation that has the Shenandoah garbage collector. I use the following JVM Arguments: -Xmx12G -Xms12G -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+AlwaysPreTouch -XX:+DisableExplicitGC
2023/05/24: Found a better string
-Xms10G -Xmx10G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1
My CPU may be beefy, but I still can't get over 16 chunk render distance without dipping below 60 fps while OBS is running. Limit render distance to 16 chunks.
Using many mods with fabric. Sodium, indium, iris, entity culling, more culling, dynamic fps, memoryleakfix, starlight, ModernFix, etc.
MoreCulling > Leaves Culling >
MoreCulling > Leaves Culling Amount > 2
6/2/2023 update: To ensure smooth gameplay while OBS is running, be sure to open OBS first, then load whatever game (in my case, java Minecraft). If I fail to load OBS first, then starting OBS makes the game run terribly. Modern fix really helped performance. I guess those bugs were killer.