1

Lag for java minecraft 1.21.10

wisqq 12/4/25 5:41 am
300
12/6/2025 3:36 am
Hi everyone,

I have a problem: while playing, there is a lag spike at a certain point, and everything freezes for a moment. This wasn't an issue when I was playing using the Legacy launcher, but it started after switching to Prism Launcher.

I've already changed the Minecraft version to 1.20.10 (from 1.21.9), changed the allocated memory (RAM), and changed the Java version to Adoptium Java 25 LTS – nothing helps. This bug is very annoying.

I also changed the JVM arguments (I don't really understand them well); currently, these are set:
-XX:+UseZGC -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:+PerfDisableSharedMem -XX:+UseDynamicNumberOfGCThreads

I am playing with mods
Posted by
wisqq
Level 1 : New Miner
0

  Have something to say?

JoinSign in

1

Yuzukodo
12/06/2025 3:36 am
Level 11 : Journeyman Explorer
history
You may try switching to Java 21 LTS, either from Adoptium or Azul Zulu.
Within Prism Launcher, you can do:
Right-click instance > Edit > Settings > Java > Download Java
------------------------------------
You can find an official list of the current JVM parameters here:
Oracle | The Java Command

Additionally:
-XX:+PerfDisableSharedMem
> prevents random disk I/O operations, leading to slightly better latency, mainly on Linux filesystems (enabled by default from Java 11+)
-XX:+UseDynamicNumberOfGCThreads
> prevents excessive thread usage with high CPU overhead (enabled by default from Java 11+)

I hope this helps! (⌒ω⌒)
1

Welcome