Leak caused by OpenBlocks?
TheRealDadbeard opened this issue ยท 3 comments
Not quite sure but I have some issues on my server and just want to sort out if openblocks causes me issues
Probably payload
needs releasing at the end of decode()
here:
https://github.com/OpenMods/OpenModsLib/blob/ce3f0610d455d317289c5c4f11b0d72f35bdfb5f/src/main/java/openmods/network/event/NetworkEventCodec.java#L52-L78
If this is fixed, write
here will probably also need updating to handle reference counts correctly:
https://github.com/OpenMods/OpenModsLib/blob/ce3f0610d455d317289c5c4f11b0d72f35bdfb5f/src/main/java/openmods/network/ExtendedOutboundHandler.java#L28-L65
See the equivalent FML code:
https://github.com/MinecraftForge/MinecraftForge/blob/3b8146a06e889fa71cea138e5f4dec66742170ac/src/main/java/net/minecraftforge/fml/common/network/FMLOutboundHandler.java#L344-L392
Fixed first part in OpenMods/OpenModsLib@777ea74.
As for second part (*OutboundHandler
), I'm not able to reproduce it, so I'm skipping that.
@bs2609 Do you know what is supposed to decrement FMLProxyPacket.payload
reference count? I can't find any instance of that (definitely not actual sending, since toS3FPackets
creates new buffers and toC17Packet
is not problem, since we only send one that one once per message). NetworkDispatcher.sendProxy
does not seem to change ref count, even when running test from MinecraftForge/MinecraftForge#4536, so I don't see why this extra reference count management is needed.