CodeChicken Lib 1.8.+

CodeChicken Lib 1.8.+

128M Downloads

LEAK: ByteBuf.release() was not called before it's garbage-collected.

cybernav92 opened this issue ยท 11 comments

commented

Here is my log : https://gist.github.com/cybernav92/66e008df38c41d79baa1933df8fbe1dc

This happens shortly after a player logs onto the server. No obvious trigger.

I have taken these similar incidents CodeChickenLib/pull/258 and CodeChickenLib/issues/220 into consideration and have downgraded/ upgraded and even tried FoxMclouds fix to remove the suspected line. Same result (above log) each time.

At this point Im pulling my hair out and this lib is too prevalent to drop. Help with a work around would be awesome.

--My CodeChickenlib dependas: (Have tried with and without most of these)--
EnderStorage-1.12.2-2.4.6.137
ForgeMultipart-1.12.2-2.6.2.83
MrTJPCore-1.12.2-2.1.4.43
ProjectRed-1.12.2-4.9.4.120
ThermalExpansion-1.12.2-5.5.4.43
ThermalDynamics-1.12.2-2.5.5.21
Chicken Chunks-1.12.2-2.4.2.74

Using forge 1.12.2-14.23.5.2847 btw.

commented

I can confirm the same issue.
Log: https://pastebin.com/ePSy5j4C
Seems to be triggered by chunk generation or loading?

commented

I also have the same issue and am wondering what the convention is supposed to be - is Netty supposed to be releasing the ByteBuf, or is the receiver of Netty's call supposed to? FoxMcloud operated on the assumption that the receiver should release it, but it appears to break other mods that use PacketCustom. This leads me to believe that Netty is just reusing the same ByteBuf for every PacketCustom and never releasing it. Somehow, though, the garbage collector is determining that Netty doesn't ever need this ByteBuf at a certain point and is throwing these leak warnings when it tries to clean it up without Netty having released it. This could potentially be a bug in Netty, or in something that modified Netty, like Forge.

commented

This seems to be a really complicated issue in 1.12, how are other mods that use EmbeddedChannels handling this? Mostly out of curiosity, 1.14 doesn't have this problem.

commented

I too am experiencing this: https://gist.github.com/KSUMatt/6a306e61cf336fb405daea83379ac808

Anyone have a feel for how often and how much memory it's leaking? I have seen my server hit 100% memory usage and start lagging - I just don't know if this is root cause or not.

commented

Any Update on this?

commented

Any attempt I have made to fix this issue has caused other issues. If someone has an example of how mods with custom EmbeddedChannels in 1.12 handle releasing the ByteBuf I would like to see that. Otherwise, in 1.15 it's not a problem.

commented

I'm having this issue too, causes the server to freeze for around ten seconds each time it happens, happens seemingly randomly

commented

Is there a way you know to reduce the impact with the server? Because we have a big server lag, it can't keep up!
Maybe some java arguments we could add to modify the Garbage Collector behavior?

commented

This is resolved in 1.15

commented

Can you please fix this issue for the 1.12 ? Because our server lags a lot!

commented

Unfortunately, 1.12 is not supported anymore, hasn't been since before this issue was first posted. The 1.15 'fix' was the entire network pipeline in Forge being rewritten.

Without proper memory & thread profiling on your server, it will be impossible to determine if CCL is the cause of your lag or not. The way this issue would manifest itself on a server would be excessive java GC's due to a memory leak. As this is the only report of this in the 5+ years this system has been deployed, I doubt there is cause for concern here, the warnings spat out by netty may be correct, but I suspect the objects are actually being cleaned up, just not how netty wants.