Severe lag spikes in 1.12.2

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,142
248
Need some help, trying to make a modpack in 1.12.2, and I'm getting extreme lag spikes every 10-15 seconds. This is in a brand new generated world with nothing built in it.
It also happens when entering any GUI screen (vanilla or modded).

Game log doesn't show anything, but shows it's getting overloaded and skipping ticks, despite memory not being filled.

Any ideas? If I can't solve this, then it's scrapping modern Minecraft and going back to good old reliable 1.7.10.
 

Pyure

Not Totally Useless
Aug 14, 2013
8,349
7,216
383
Waterloo, Ontario
Need some help, trying to make a modpack in 1.12.2, and I'm getting extreme lag spikes every 10-15 seconds. This is in a brand new generated world with nothing built in it.
It also happens when entering any GUI screen (vanilla or modded).

Game log doesn't show anything, but shows it's getting overloaded and skipping ticks, despite memory not being filled.

Any ideas? If I can't solve this, then it's scrapping modern Minecraft and going back to good old reliable 1.7.10.
That's weird dude. Is it when you first enter the world, and things are still generating by any chance? I've noticed that my 1.12 worlds need a minute to catch up sometimes.
 

SevenMass

Well-Known Member
Jan 2, 2013
282
137
69
The Netherlands
The behavior you describe is very consistent with my experiences when I don't have enough RAM allocated.

Or when there is way to much RAM allocated, due to a quirk in java's memory management. Yet, modded mc v1.10+ needs a lot of ram...

Unless you have a small modpack, modpacks in mc v1.10+ need about 6 GB allocated to them, where in 1.7.10 this would be 4 GB.

Using java arguments, you can tweak the memory management to be more optimized for modded minecraft.

Code:
-XX:+UseG1GC -Xmx4G -Xms4G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
Link to reddit post explaining above arguments.

Note that "-Xmx4G -Xms4G" in the above code snippet allocates 4GB of memory. Also note that most launchers have a GUI for allocating memory, if you use such a launcher you need to use that and leave those arguments out.
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,142
248
That's weird dude. Is it when you first enter the world, and things are still generating by any chance? I've noticed that my 1.12 worlds need a minute to catch up sometimes.
World gen lag I can understand and appreciate, but I'll be just standing in a generated area, and currently browsing through JEI learning how things interact for the pack I'm designing

The behavior you describe is very consistent with my experiences when I don't have enough RAM allocated.

Or when there is way to much RAM allocated, due to a quirk in java's memory management. Yet, modded mc v1.10+ needs a lot of ram...

Unless you have a small modpack, modpacks in mc v1.10+ need about 6 GB allocated to them, where in 1.7.10 this would be 4 GB.

Using java arguments, you can tweak the memory management to be more optimized for modded minecraft.

Code:
-XX:+UseG1GC -Xmx4G -Xms4G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
Link to reddit post explaining above arguments.

Note that "-Xmx4G -Xms4G" in the above code snippet allocates 4GB of memory. Also note that most launchers have a GUI for allocating memory, if you use such a launcher you need to use that and leave those arguments out.
Have 6gb allocated, using Twitch and Native launcher. Only 80 mods (so far) loaded in the pack (so quite tiny compared to 1.7.10 packs) and using a 32x resource pack that I always use.
I'll see if those arguments help in the advanced settings.
 

SevenMass

Well-Known Member
Jan 2, 2013
282
137
69
The Netherlands
In that case 6GB is probably overkill. My personal modded 1.12 instance has 93 mods and I gave it only 4GB. I'm using mojang's 1.13 resource pack beta.
I'm also using foamfix. Though it was also running OK without foamfix.

See if it helps to reduce the memory allocation to 4GB.

If all that fails, it could be a problem with one of the mods, or a combination of mods. To figure that out, you'll have to play detective; Disable half your mods, and then the other half, etc.
 

zBob

New Member
Jul 29, 2019
247
0
1
No idea how significant a change this could make but the defualt Twitch launcher utilizes java 8 update 25, you can go into the options and select the jar launcher and select a much more recent version you should have installed on your system.

There is a google doc here showing anyone how to find that config option in case you were not aware:
https://www.reddit.com/r/feedthebea...ch_launcher_forcing_old_java_versions_on_you/

For testing stuff out you might consider copying your pack over to a MultiMC instance and launching it from there, it seems to have a more detailed running log while playing and that could help you troubleshoot as well.
 
  • Like
Reactions: Golrith

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,142
248
Thanks, didn't realise that the twitch launcher is an out of date java. Turns out my system was slightly newer, but not completely up to date, so that's been updated.

Twitch launcher is "great" for building up a pack, but it's damn clunky. I used to build the packs within the vanilla launcher under a new profile.
 

Hambeau

Over-Achiever
Jul 24, 2013
2,602
1,533
213
Thanks, didn't realise that the twitch launcher is an out of date java. Turns out my system was slightly newer, but not completely up to date, so that's been updated.

Twitch launcher is "great" for building up a pack, but it's damn clunky. I used to build the packs within the vanilla launcher under a new profile.
The "Twitch" launcher doesn't install Java... It calls the Mojang Vanilla launcher which automatically installs ver. 1.0.8_25 because that's the version Minecraft is currently developed with.

When Mojang decides to develop Minecraft with a newer Java version they will change the version their launcher auto-installs at runtime.