Not allocating RAM efficiently/correctly?

I'm on a 12th gen intel processor and see RAM overload, except my game refuses to allocate outside the instance and caps itself at the 8gb I have it set to. Causes major lag spikes after so many days playing because loading anything ends up using the entire allocation instantly before purge repeatedly in certain scenarios. 3070, 12700k intel processor, 32gb RAM. Allocating above 8gb I have seen cause unavoidable purge lag spikes, but allocating about 10gb is where DH behaves best, I've read. I've used DH on a couple different modpacks now with very different sets of mods, and even in vanilla instances it refuses to use RAM outside allocation like it's suppsed to (?). I can't see a good balance point for this. Setting it to lowest CPU usage and pregenning for days helps for immediate chunk visibility, but just existing in preloaded chunks has become laggy. These are chunks that have been loaded for hundreds of days with a very wide perimeter, so I can't see why RAM would spike like that. This is especially noticeable when traveling in the Nether or Aether, even at low speeds like when mining tunnels, which is maybe 0.2m/s speed. No more or less noticeable when riding a fast horse down said tunnels, or flying a moa over long distance in Aether. On a much heavier modpack, it's nearly impossible to avoid having to restart the game every 30min-1hr just existing after preloading over 20k in each direction. The game not only requires a bit more RAM than usual, something like 3gb standing, it eats it up WAY faster with DH working. I never have distant generation on in this instance. The game behaves like it has a memory leak, but I have yet to find any plausible culprit other than DH. This would be on DH v2.1.2 and a couple versions below for all of this. I thought this issue was limited to having too much land cached as LODs, which kind of helped, but just existing seems to cause degradation of performance.
18 Replies
Big Boy
Big BoyOP4mo ago
I'm unfamilar with JAVA versions that are supposed to work with Minecraft better/worse, as I'm only just now getting into programming. Could it be that I have a version that's hindering this feature? About Java says I have version 8, though I see much online that says 7 is the best version or that I need to update to 21. It's pretty confusing with the little explanation given All of my cores hit 90%+ on balanced btw, I just checked on smaller pack. Everything renders very fast, but tends to keep being slow after the fact. CPU overall usage is at 40-90 Actually the game just crashed... for the first time
majo24
majo244mo ago
Why do you think mc is supposed to allocate outside its memory limit? Logs could be helpful /logstored
YAGPDB.xyz
YAGPDB.xyz4mo ago
You should send your latest.log file to provide additional useful information. Logs are located in the .minecraft/logs directory. On Windows: %appdata%\.minecraft\logs On Linux: ~/.minecraft/logs On Mac: ~/Library/Application Support/minecraft/logs Please upload the file to mclo.gs instead of sending the raw file. This makes reading the contents of the file a lot easier and improves the chances of you getting the help needed. After uploading the file, click on Save and send the link.
Big Boy
Big BoyOP4mo ago
Doesn't DH take from outside the game?
majo24
majo244mo ago
You sure you're on Java 8? IIrc, mc 1.20 requires Java 17 and mc 1.20.5+ Java 21
Big Boy
Big BoyOP4mo ago
"version 8" about java has terrible details Could be java 17 v8 for all I know
Big Boy
Big BoyOP4mo ago
No description
majo24
majo244mo ago
No, DH is a part of the minecraft task. The minecraft task has a memory limit, and since DH is part of minecraft, it cannot exceed the memory limit I would recommend using Java 21
Big Boy
Big BoyOP4mo ago
I see in other RAM posts that DH pulls from outside when it needs to, or am I misunderstanding that? It's fairly direct language when referred
majo24
majo244mo ago
When DH runs out of VRAM, it will allocate to RAM, even if its out of memory limit. However this only rarely happens
Big Boy
Big BoyOP4mo ago
In the case that it doesn't, it's using a gargantuan amount of RAM very very fast, and allocating more hardly helps since it just fills that buffer and causes bigger purge lag
majo24
majo244mo ago
Java Flags and the ZGC with Generational could also help, especially with lag spikes caused by the GC
Big Boy
Big BoyOP4mo ago
What version of 21
majo24
majo244mo ago
Newest Java 21
Big Boy
Big BoyOP4mo ago
seems to have worked installing no idea about performance yet Forgematica crash. Amazing timing to suddenly break I'll uninstall temporarily, seems to load everything faster, which is cool It even crashed faster Okay it was because I updated DH from 2.1.0 to 2.1.2, that's a major issue
Miki_P98
Miki_P984mo ago
You can't have modern MC on JAVA 8 If you installed only JAVA 8, you MC launcher installed a java version by itself in its files ant it uses that And that is either JAVA 17 or 21 If you want to get rid of the lag spikes you can tune the GC as majo said Those are in theory ones of the best GC flags -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+ZGenerational -XX:+AlwaysPreTouch -XX:+UseFastUnorderedTimeStamps But that will only wotj with JDK 21 you can most likely override the JDK version in the launcher to launch MC with JDK 21
Miki_P98
Miki_P984mo ago
Here it is on Modrinth
No description
Miki_P98
Miki_P984mo ago
DH recommend RAM amount is 4096 MB + ({your CPU thread count} * 512 MB If you have many other mods you can add another 2 GB My DH with many other mods (170 in total) uses 18 GB with ZGC
Want results from more Discord servers?
Add your server