Lag spikes with distant generation enabled

Hi! I'm trying to use Distant Horizons, however, if I enable distant generation in the mod settings, I get very large lag spikes that get progressively worse as the world is loaded for longer, eventually completely hanging the game
Solution:
also I can confirm: the incompatibility is between distant horizons and geocluster
Jump to solution
41 Replies
Rado
Rado•3mo ago
No description
Certified P. Drizzy
Certified P. Drizzy•3mo ago
ram allocation?
Rado
Rado•3mo ago
16 gigs, increased from 8
Yeshi
Yeshi•3mo ago
probably too much. how come you increased from 8?
Rado
Rado•3mo ago
trying to fix this issue once the hanging issue starts, modernfix gives a thread dump, I have no idea if anything in there might be a hint
Certified P. Drizzy
Certified P. Drizzy•3mo ago
give it 5-6 or you can switch GC if you want high ram allocation
Rado
Rado•3mo ago
hardester
hardester•3mo ago
If I see that, it means you have too much memory from the get-go...
Rado
Rado•3mo ago
okay, lemme try that I should also mention that this is a modpack, although none of the mods I have are listed on the incompatible list
Certified P. Drizzy
Certified P. Drizzy•3mo ago
if ram allocation/gc doesnt help with that, test with dh alone
Rado
Rado•3mo ago
how would i switch the gc if i may ask
Certified P. Drizzy
Certified P. Drizzy•3mo ago
change flags in jvm arguments, you can google that (shenandoah/zgc)
Rado
Rado•3mo ago
same issue occurs with 6 gigs of RAM allocated
hardester
hardester•3mo ago
Have you changed any other JVM options other than memory allocation?
Rado
Rado•3mo ago
okay, lemme try with zgc no (well, until now since I'm trying zgc)
hardester
hardester•3mo ago
Likely you still set too much memory then. Well, no longer relevant now that you're switching GC.
Rado
Rado•3mo ago
i think I have too little memory set, because I seee the usage going to 100%, then I'm getting a huge lagspike, and it's only going down to like 80% (with zgc)
Rado
Rado•3mo ago
I also got this now that I haven't gotten before before the game completely hung
No description
Certified P. Drizzy
Certified P. Drizzy•3mo ago
you can raise that up with new gcs otherwise ^
hardester
hardester•3mo ago
ZGC, to my experience, benefits having more memory. It suffers at lower memory much worse compared to G1.
Rado
Rado•3mo ago
it took longer, but I'm once again at a point where my memory usage is hitting 100%, dropping down only a little bit before hitting 100% and the app hanging for seconds while it does a hard GC (with 16 gigs ram allocated) let me try with just dh and see if it happens there okay, the issue doesn't seem to happen with just dh. what type of mod is likely to be incompatible, so i know where to start looking?
Rado
Rado•3mo ago
an interesting thing I did notice is that the world gen tasks climbs to pretty insane numbers, i don't know if that's normal or not
No description
Certified P. Drizzy
Certified P. Drizzy•3mo ago
i suggest you try nightly build in #links-n-downloads 2.0.4 performance is a lot better
Rado
Rado•3mo ago
alright, lemme try that it's a lot better on the nightly build, but after a while I still end up in the situation where I'm at 100% memory and the garbage collector can't seem to free almost any memory at all ah, I think i might see what the incompatibility is
Rado
Rado•3mo ago
I think the hanging might've broken some things
No description
Solution
Rado
Rado•3mo ago
also I can confirm: the incompatibility is between distant horizons and geocluster
Rado
Rado•3mo ago
more specifically, distant horizon's features worldgen seems to be incompatible - it seems that surface works alright
Certified P. Drizzy
Certified P. Drizzy•3mo ago
geocluster might do some cursed stuff send latest.log while using features
Rado
Rado•3mo ago
sec
Rado
Rado•3mo ago
Certified P. Drizzy
Certified P. Drizzy•3mo ago
DH only spit errors a few time related to geocluster modernfix seems to freak out might be debug/logging from modernfix
Rado
Rado•3mo ago
i think modernfix is detecting that the server tick is getting overly long and dumping threads to help with debugging my best guess is that what's happening is that geocluster tries to spawn things on top of blocks as a feature, but distant horizons' worldgen doesn't actually generate blocks(?) and so geocluster's feature spawn code waits infinitely for a block that will never be generated and eventually all these endlessly waiting threads fill up the RAM that being said let me try without modernfix and see if that changes anything issue still seems to occurr without modernfix
Rado
Rado•3mo ago
this time i even crashed due to OOM
Certified P. Drizzy
Certified P. Drizzy•3mo ago
just remove geocluster atm
Rado
Rado•3mo ago
thanks a lot for your help
BackSun
BackSun•3mo ago
Dang it I was hoping to see monoliths. All I got was a memory leak. 🙃 Yeah it looks like geocluster is trying to do something that is incompatible with DH's world gen. Looking at VisualVM they appear to just be infinitely adding items to a ConcurrentHashMap. My guess is they're trying to generate something outside the 4x4 section DH uses when generating terrain. Might be worth bringing it up to them.
No description
No description
No description
hardester
hardester•3mo ago
What in the world is that class tree???
BackSun
BackSun•3mo ago
Minecraft world gen 😎
hardester
hardester•3mo ago
If I can curse, I would've placed a stupid long list of curse words. :mojank: moment...
Yeshi
Yeshi•3mo ago
atp sample the memory usage graph for the shapes of mountainranges :trolllaugh:
No description
Rado
Rado•3mo ago
As far as I can tell the mod is abandoned, so even if I reported it I doubt it would get fixed thanks for taking the time to look into what the actual issue is though!