MacBook Pro Issue with Frequent Lag Spikes in Newer Java versions (e.g. 1.21+)
Hi, so this seems to be **a common issue among other Mac users**. I feel like I've tried everything.
No, I have not verified which versions have this issue. However, I do know that I have not experienced the significant lag spike issue in older versions (such as 1.12).
**What is the exact issue at hand?**
I don't know the cause, which is why I am posting this today. However, the issue is that my Minecraft (like 1.21.4 for example) **runs very smoothly** with lowered quality and performance settings and applying optimization mods, **but then gets a random** FPS (frames-per-second) **spike** once every 15 seconds or so.
**I average 70-110 FPS** and when the lag-spike hits, it **drops down to 2 fps** (according to the Fn3 debug menu) for anywhere **between 1-3 seconds.** \[In reality the lag-spike isn't 2 fps but more like a frozen screen for said time period\].
This is a persistent issue in newer Java versions and it is very annoying. (I'm sure you can imagine the pain when I'm trying to explore caves and fight off mobs but then I get the lag-spike.
**What am I using?**
2021 MacBook Pro | M1 Pro | 16GB
**Which Client am I running?**
I am using **modded Minecraft** via *Modrinth.*
**What have I tried so far?**
Well first off, like the majority of other users, I have tried using performance optimization mods.
Now *these raise the average FPS* which is really nice, my game feels super smooth.
These however, do NOT fix the fps drop issue.
I've looked many places online and I have not yet found a solution even on other reddit posts with other users stating similar issues.
Some posts suggested the issue being the Garbage Collector and/or allocating the appropriate amount of RAM.
I've tried raising my allocated memory from 2GB to 8GB with no success in resolving the issue.
I've also tried applying a custom Java argument that I found on another reddit post from a user (that had an MacBook M3 Chip on MC version 1.21.5) to the installation and that hasn't worked either.
The argument is as follows:
\-Xms4G -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=40 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=100 -XX:+ParallelRefProcEnabled -XX:ParallelGCThreads=4 -XX:+AlwaysPreTouch
[Someone with an M1 Chip](https://www.reddit.com/r/Minecraft/comments/1jkgr3x/is_anyone_experiencing_massive_frame_drops_upon/) was experiencing trouble on version 1.21.5 and people have [quoted a bug on Mojira](https://bugs.mojang.com/browse/MC/issues/MC-295893) that stated the issue was because the game experienced a rendering change and that the game now uses a different method to store buffer data and that for MacOS, rendering is postponed until bufferdata is updated. (or something like that sadly I'm not the most technical person)
\^ I feel like that issue doesn't really apply to my situation because I still experience the issue on versions under 1.21.5 (Like 1.21.4 or 1.21.1)
**Is anyone else experiencing a similar situation?** (I know there are people, I just need people to upvote this post and comment on it so that it can get a fix because there are many people experiencing this)
**Has anyone found any solutions that work? Or does anybody else have any suggestions or things I should try?**
**If anyone has an answer, please explain it technically (and also in simple English).** I know it takes a few more minutes, but this way, I can learn the technical side of things and everyone will be able to easily understand it.
No, I have not verified which versions have this issue. However, I do know that I have not experienced the significant lag spike issue in older versions (such as 1.12).
**What is the exact issue at hand?**
I don't know the cause, which is why I am posting this today. However, the issue is that my Minecraft (like 1.21.4 for example) **runs very smoothly** with lowered quality and performance settings and applying optimization mods, **but then gets a random** FPS (frames-per-second) **spike** once every 15 seconds or so.
**I average 70-110 FPS** and when the lag-spike hits, it **drops down to 2 fps** (according to the Fn3 debug menu) for anywhere **between 1-3 seconds.** \[In reality the lag-spike isn't 2 fps but more like a frozen screen for said time period\].
This is a persistent issue in newer Java versions and it is very annoying. (I'm sure you can imagine the pain when I'm trying to explore caves and fight off mobs but then I get the lag-spike.
**What am I using?**
2021 MacBook Pro | M1 Pro | 16GB
**Which Client am I running?**
I am using **modded Minecraft** via *Modrinth.*
**What have I tried so far?**
Well first off, like the majority of other users, I have tried using performance optimization mods.
Now *these raise the average FPS* which is really nice, my game feels super smooth.
These however, do NOT fix the fps drop issue.
I've looked many places online and I have not yet found a solution even on other reddit posts with other users stating similar issues.
Some posts suggested the issue being the Garbage Collector and/or allocating the appropriate amount of RAM.
I've tried raising my allocated memory from 2GB to 8GB with no success in resolving the issue.
I've also tried applying a custom Java argument that I found on another reddit post from a user (that had an MacBook M3 Chip on MC version 1.21.5) to the installation and that hasn't worked either.
The argument is as follows:
\-Xms4G -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=40 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=100 -XX:+ParallelRefProcEnabled -XX:ParallelGCThreads=4 -XX:+AlwaysPreTouch
[Someone with an M1 Chip](https://www.reddit.com/r/Minecraft/comments/1jkgr3x/is_anyone_experiencing_massive_frame_drops_upon/) was experiencing trouble on version 1.21.5 and people have [quoted a bug on Mojira](https://bugs.mojang.com/browse/MC/issues/MC-295893) that stated the issue was because the game experienced a rendering change and that the game now uses a different method to store buffer data and that for MacOS, rendering is postponed until bufferdata is updated. (or something like that sadly I'm not the most technical person)
\^ I feel like that issue doesn't really apply to my situation because I still experience the issue on versions under 1.21.5 (Like 1.21.4 or 1.21.1)
**Is anyone else experiencing a similar situation?** (I know there are people, I just need people to upvote this post and comment on it so that it can get a fix because there are many people experiencing this)
**Has anyone found any solutions that work? Or does anybody else have any suggestions or things I should try?**
**If anyone has an answer, please explain it technically (and also in simple English).** I know it takes a few more minutes, but this way, I can learn the technical side of things and everyone will be able to easily understand it.
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
If this is really a Java version that just doesn't work well with MacOS like what was basically said in Mojira, would I need to wait for the next update or is there actually a solution that is available that still lets me use these relatively newer versions with no issues?
The most common cause on M-series mac is running the game through Rosetta instead of using the native ARM64 runtime in the launcher. This will cause very frequent lag spikes.
Try switching to ZGC instead of G1GC, something like \`-XX:+UseZGC -XX:+UnlockExperimentalVMOptions\` in your JVM args. Also make sure you're running the ARM64 version of Java, not the x86 one through Rosetta
The buffer rendering bug you mentioned is real but ZGC should help minimize those GC pauses that cause the freezing
How can I check which Java I'm running ?
"For those checking back here and want the quick workaround, here's what did it for me:
1. In the Launcher, go to Settings (lower left), General, scroll down, and ensure that "Use Arm64 Java runtime for Minecraft: Java Edition" is **checked**.
2. If you don't have this option, make sure to **uncheck** "Use beta version of the Launcher" and restart the Launcher; then check the box by "Use Arm64 Java runtime for Minecraft: Java Edition". (You can then go back to the beta after this if you like.)
3. There's no step 3.
Enjoy."
Hatte das gleiche Problem mit den Lag Spikes und das hat es bei mir behoben