Cold Sweat

Cold Sweat

3M Downloads

Possible issue with memory leak

Maypul opened this issue ยท 7 comments

commented

MC: 1.19.2 / Forge: 43.2.21
Mod list (client): https://pastebin.com/Js1fz01f

Snip from the error:
[08:41:26] [Server thread/FATAL] [ModernFix/]: A mod is accessing chunks from a stopped server (this will also cause memory leaks)
java.lang.Exception
at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerChunkCache.handler$zec000$bailIfServerDead(ServerChunkCache.java:1596)
~ cut for char limit~
at TRANSFORMER/[email protected]/net.minecraft.world.level.biome.BiomeManager.m_204214_(BiomeManager.java:79)
at TRANSFORMER/[email protected]/com.momosoftworks.coldsweat.api.temperature.modifier.BiomeTempModifier.calculate(BiomeTempModifier.java:52)
at TRANSFORMER/[email protected]/com.momosoftworks.coldsweat.api.temperature.modifier.TempModifier.update(TempModifier.java:60)
at TRANSFORMER/[email protected]/com.momosoftworks.coldsweat.api.util.Temperature.apply(Temperature.java:114)
at TRANSFORMER/[email protected]/com.momosoftworks.coldsweat.api.util.Temperature.apply(Temperature.java:130)
at TRANSFORMER/[email protected]/com.momosoftworks.coldsweat.api.util.Temperature.getTemperatureAt(Temperature.java:138)
at TRANSFORMER/[email protected]/net.minecraft.world.entity.item.ItemEntity.mdb608ee$lambda$tickFood$0$0(ItemEntity.java:1034)
at TRANSFORMER/[email protected]/net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:150)
at TRANSFORMER/[email protected]/net.minecraft.world.entity.item.ItemEntity.handler$bfl000$tickFood(ItemEntity.java:1033)
at TRANSFORMER/[email protected]/net.minecraft.world.entity.item.ItemEntity.m_8119_(ItemEntity.java:98)
at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.track(ServerLevel.java:6240)
at TRANSFORMER/[email protected]/net.minecraft.server.level.ServerLevel.redirect$dko000$onTickNonPassenger(ServerLevel.java:6256)
~ cut for message limit~
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244)
at java.base/java.lang.Thread.run(Thread.java:833)

The issue: it seems that with combination of mods there is some memory leaking, in the error catched by ModernFix it seems like it could be Cold Sweat issue (it mentions the mod).
How to reproduce: Have the mod list, enter the world, do something, leave the world, enter the world again, do something, and there is a chance these error happen.
I managed to remove the error if I remove from the pack: Thermal Expansion or Freeze It, and Heat It! (addon to Cold Sweat) but these mods does not seem like the core issue - I am having an issue with finding core issue ,as running an instance with only Thermal mods, Modern Fix and Cold Sweat + addon the error does not happen, but the error itself mentions Coldsweat. Observable was removed and the issue still happened.

I can't say for sure it is solely Cold Sweat issue, maybe it is a combination of few mods, hopefully you can provide some info that could help with identyfing the real issue.

Full example latest.log: https://easyupload.io/mikitm and newlog.txt (with -Dmodernfix.debugBadChunkloading=true flag to log more error message)

commented

It looks like Freeze It, and Heat It! is the source of the issue. I don't know exactly how, but somehow it seems they are trying to get the temperature at a certain location when the world isn't loaded. I know it's that mod because they use a specific function (getTemperatureAt) that Cold Sweat does not use in that context.

commented

That is how it looks like but then if I leave it enabled and remove for example Thermal Expansion, I do not get these errors anymore or had bad luck testing it many times... It's strange issue. I will remove the addon and check randomly for these errors if they happen on their own during my tests.

commented

I'm not sure about the thermal expansion part. To my knowledge neither mod has anything to do with it.

commented

I will report it to them and also keep an eye on this issue with this mod disabled. Thank you for your help :)

commented

Well, that's annoying. It was a single line of code. Now I gotta reupload 10 files >:(
I'll be replacing the existing versions on CurseForge and Modrinth with the patched version shortly. Try redownloading in about 30 minutes.

commented

Hi, I have updated the mod to 2.2.3 seeing as it had a fix for this issue, readed Heait and and Freeze it mod, joined a world, placed some blocks it crashed:https://pastebin.com/cdYKrLGJ

commented

Based on a really short test, seems alright now. Thanks :)