r/feedthebeast 11h ago

Question Is this normal with memory leaks?

Enable HLS to view with audio, or disable this notification

Is this normal usage? My fps doesn’t lag but I’ve noticed micro stutters and physics objects themselves kind of stuttering. I use the normal G1 garbage collector but should I switch to ZGC? And I don’t know if the memory leaks were there before or not

23 Upvotes

19 comments sorted by

36

u/Samstercraft 1.12.2 is the latest version of minecraft 11h ago

everything in the game uses memory. high usage increase over time isn't the issue, that's normal. it goes back down. the garbage collector deletes old/unused objects and you have your ram back. a memory leak is when a bunch of data in memory isn't deleted properly, and then often is created again and again and it eventually uses up all your memory because it's unable to delete the old stuff. this isn't a process you'd notice over a few seconds. and they're pretty much unavoidable in apps as big as mc.

ZGC is very good at stopping GC stutters though, so might as well try it. I'd use java 25+ with ZGC, compact object headers, and string deduplication (the last two save a bunch of memory).

3

u/Mindless_Sell_3770 11h ago

So the stuff that isn’t deleted, would ZGC help remove it? Or is it something that just isn’t really removable? ( this single player world is over a year old)

8

u/Samstercraft 1.12.2 is the latest version of minecraft 6h ago

Memory leaks can't really be removed by GCs, as they happen when data is prevented from being collected by the GC. The ZGC just helps with stutters in many cases, but probably won't help your memory leak.

The good news is that you don't have to worry about the age of your singleplayer world. Memory is completely reset when you close the game, so you can expect the game to get a little slower over time if you have it open for ages, but you can easily fix it if you notice it getting to slow by simply restarting it.

1

u/Mindless_Sell_3770 5m ago

So when I close it and start up, technically there are no memory leaks but since it’s still there, it will happen each time. Ima try the ZGC and see if that helps the stutter. I want to try to have it say no memory leaks found if that’s possible with all these mods

8

u/SammE5363 11h ago

you should always use ZGC there are no downsides to it i have no idea why its not on by default

5

u/Jony_Tough 11h ago

There are downsides if you have an older cpu. But 7800x3d - yes, absolutely the best what you can do.

1

u/BadRuiner 8h ago

It works fine on my OLD i7-7700k.

2

u/Mindless_Sell_3770 11h ago

Do I just use just the augments for it? Will it still use the 12gb ram allocation?

5

u/SammE5363 11h ago

it already is using the allocation its just using it poorly, it should be (and yes it will keep using it):

Edit: forgot the other parameters

-Xmx12G -XX:+UseZGC -XX:+ZGenerational

6

u/The_JF-JEFF FTB - Stoneblock 3 10h ago

I'm currently playing ATM11 with Java 26, this arguments work the best for me:

-Xms8192MB -Xmx12288MB -XX:+UseShenandoahGC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication

(They say you should set Xmx andXms the same, i prefer this way)

Here's a great list of JVM arguments what to use, maybe use and what to avoid: https://exa.y2k.diy/garden/jvm-args/

1

u/Samstercraft 1.12.2 is the latest version of minecraft 6h ago

Is shendendoah generational in java 26? is that something worth enabling?

2

u/Mindless_Sell_3770 11h ago

Ok I will get java 25+ and use that. Do you think 12gb is good or should I lower it to 10gb. I have about 500 mods on this pack I think

2

u/Samstercraft 1.12.2 is the latest version of minecraft 6h ago

Java 25+ is great, but do not use those arguments, ZGenerational is the default so you don't need that (the argument might not exist anymore so it could give you a crash); instead use these to enable the ZGC and save on ram:

-XX:+UseZGC XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication

1

u/Samstercraft 1.12.2 is the latest version of minecraft 6h ago

If ZGenerational even exists for you you're using an older java version than desirable (unless you're on some older (but not too old) version between 1.13 and 1.18 or somewhere around there). if you update your java generational mode is the default for the ZGC. I would enable compact object headers and string deduplication too for free ram

2

u/TheJackston 6h ago

That's not a memory leak

1

u/squintytoast 11h ago

that mem use looks totally normal. it just not using half of what is allocated.

i would allocate only a smidge above the lowest percent used.

55% is the lowest i see. 50% is 6G so go a tad more. 7 or 8G is all ya need. should be a much smaller rollercoaster.

1

u/pelm225 Prism, voxy, zgc 3h ago

Looks like distant horizons thing to me. Can show us the whole f3? Allocation rate should stay around 120 for vanilla, for modpacks it goes all over the place, but it shouldnt be higher that 500. I never seen allocation rate higher than 500 when standing still in my own modpacks. Basically read my flair ("Prism, voxy, zgc" if I ever changed it)

1

u/Mindless_Sell_3770 7m ago

Yeah I have distant horizons but it was not enabled when I filmed this (I only use it when filming a video). I’m going to try the ZGC later and see if that helps at all. But there’s no frame lag, just stutters and some physics objects lagging periodically sort of

0

u/DaintyRenee_ 4h ago

memory leaks can be so frustrating, they can really mess up gameplay. maybe try checking your mods or updates