Moonlight Lib

Moonlight Lib

86M Downloads

moonlight lib causing java heap crash

ianm1647 opened this issue ยท 44 comments

commented

Minecraft version: 1.19.2
Moonlight lib version: 2.1.15

moonlight lib is causing a java heap crash with my set of mods, i will provide the crash log here

everytime i join a world and sit there for a while, leave the world and try to rejoin. the game crashes with a java heap error

after removing moonlight lib and all of its dependents (every compat, snowy spirit, supplementaries and vertical slab compat), the crash doesn't happen anymore.
i have no idea if this is a conflict issue with another mod in the list but it just seems to be moonlight lib filling up the log.

if you know how i can resolve this on my side lmk, unless its just a thing you need to do on the development side of things.

commented

Increase ram? Every compat can register a lot of blocks which need resources. Of course it's going to use less if you remove mods

commented

Increase ram? Every compat can register a lot of blocks which need resources. Of course it's going to use less if you remove mods

i was watching my ram usage the entire time , considering i have the max allocation at 8192 mb , which is more than plenty.
my usage sat at 50% the entire time, so i have no idea what could be causing it. i can try increasing ram to see if thats the problem. i will return if the problem persists

commented

ran the modpack with 10240 allocated and the problem persisted

edit: after even more testing , i decided to run the pack without every compat and the problem is still persisting

seems as if moonlight lib is still the culprit here

commented

can you give me steps to replicate?

commented
  1. load into a world
  2. wait (if you want to speed the process up , just do /reload 3 or 4 times, maybe more depending on how many mods you have loaded)
  3. leave world
  4. try and rejoin

edit: as you reload have the f3 screen open, you'll see the ram usage increase with every reload, not going back down
i can recreate this with all of the dependent mods i listed (ec, slab compat, supplementaries, snowy spirit)

commented

Let me know if it is fixed for you

it seems i closed it too soon, the leak is still somehow happening
its still only occuring with vertical slab compat

commented

okay sounds great! thank you for helping out and im glad to have helped you in the process

commented

Yeah thanks for finding it

commented

Let me know if it is fixed for you

commented

Ok ty

commented

so a little side note: if you give the game too much ram the java garbage collector will get lazy so it will let the game grab more and only really start cleaning stuff when getting closer to the limit

commented

i cant replicate. heres what i did:

  • load up a world with just the mod
  • wait a bit and /reload many times
  • re enter the world and try again

in all this the reload command didnt increase ram at all.
re entering did but only noticeably the first time. overall the memory would consistently stay between 3 and 3.5 GB, most of the times at 3.3. thi was done with default memory settings

commented

im still confused as to how im having this problem then, because the games memory usage is stable around 3.5 gb for the majority of the time whenever i DONT have moonlight lib, but once i add moonlight lib into the mix it changes things completely. albeit im running around 250 mods working on a modpack, but still the only thing that ive ran into that causes problems is moonlight lib.

commented

i also disabled the main mod entry point and run the game, effectively
without it and got similar results

commented

how much ram i it increasing? Thing is the only active thing the mod does on its own is detect wood types and colors my making a map with those blocks. This happens once at boot

commented

every time i reload, the % usage goes up by around 10% each time i run the command

commented

are you using any other of my mods?

commented

the testing i did was with the ones i had listed, i can run it again with just moonlight lib and see

commented

if its an issue its with one of the mods. as ive said this pretty much does nothing on its own but of course removing it will also require removing my other mods so if theres an issue it will be noticeable

commented

it appears to have stopped happening with just moonlight lib alone, so now it just comes down to process of elimination

commented

okay i've ACTUALLY found the culprit now, its vertical slab compat

commented

Hmm with latest version? I'll upload a vertical slab version too

commented

uh the new one 0.0
sussy

commented

did you test every compat too? maybe its something with the tag generation. if that was the case however i would expect EC to be way more noticeable as it can potentiallly register an absurd amount of blocks depending on the pack

commented

did you test every compat too? maybe its something with the tag generation. if that was the case however i would expect EC to be way more noticeable as it can potentiallly register an absurd amount of blocks depending on the pack

every compat seems to be working just fine for me, the problem is gone now that vertical slab compat isnt present

i have every compat running with mrcrayfish furniture, biomes o plenty, quark, and decorational blocks and nothing bad is happening

commented

i can say every compat does exponentially increase memory usage by about 20% but it doesnt slowly increase the usage as vertical slabs does

commented

I found it too. I'm trying to figure out what's going on. It seems inconsistent as it only happens on some realoads but there definitely is a memory leak. Furthermore I believe it only happens here for total chance as tags were eroneously getting generated on each reload unlike on EC where its only at startup. Lucky coincidence otherwise it would have gone unnoticed as even there in EC they still leak some resource even if just once

commented

well I found 2 issues actually. One that would potentially leak resources (a tag json) and the other which would just make a tag grow exponentially after every reload as it would just add stuff to it. Seems to explain it as the first alone would be negligible and the second wouldnt not be noticeable at all on its own

commented

yeah i can test it

commented

I'm uploading a new moonlight verstion (the tag generation code is in here). Could you test it?

commented

sounds like an interesting situation though, easy fix hopefully ?

commented

yeah. I tested and it seems to be solved

commented

i have to say i could replicate it consistently before. only took 10 reloads or so. now with the version i posted memory stays constant and noticeably lower so idk

commented

another noticeable thing with the new moonlight version seems to be the localized names for all of the every compat items dont seem to be loading. not sure if you do that through moonlight or not but the names have disappeared

edit: could just be something on my side, but probably not considering i havent changed anything

commented

i have to say i could replicate it consistently before. only took 10 reloads or so. now with the version i posted memory stays constant and noticeably lower so idk

all i know is that in the modpack its still leaking, i'll try individually again

commented

it is still leaking individually as well, you may have to reload around 15+ times to get results, but i managed to crash the game again

image

commented

Try with the vertical slabs version I just posted

commented

Try with the vertical slabs version I just posted

it still hasn't gone through yet for me

commented

Oh yeah CF taking its time

commented

ok its finally up now, i can test it

commented

seams as if its still leaking somewhere, just not as fast , but its still noticeable

commented

was this with newest vertical slabs mod?

commented

was this with newest vertical slabs mod?

it was with the newest versions for both moonlight and vertical slabs

commented

So all this should be fixed