
Client side memory leak with Direct Buffers
aria1th opened this issue ยท 6 comments
I checked this with MemoryMXBean Direct pool size check.
Krypton does not release direct buffers in client side.
It happens when BlockEntityData is fully sent to client, which is usually non-vanilla behavior.
Direct Buffer Pool will increase size until it reaches memory limit, and OutOfMemory occurs, directly or indirectly if other mods are using direct memory allocation.
Without a reproducer case I will not be able to take action. I am skeptical that this is a bug in Krypton.
without.mp4
with.mp4
it eats 4MB of buffer every 3 seconds with krypton. The only difference is krypton...
Also its directbuffer pool size is from IRIS
https://github.com/IrisShaders/Iris/blob/1.18/src/main/java/net/coderbot/iris/mixin/MixinDebugScreenOverlay.java
Well, Krypton sets a lower size for Netty buffer areas - 4MiB instead of the default 16MiB. This by itself explains the allocations being exactly 4MiB. The evidence you've provided means nothing except for the mod working as intended - it doesn't even necessarily show a memory leak.
I'm happy to further debug this issue, but the evidence you've provided me doesn't mean anything.
Managed to reproduce. As it turns out, Minecraft disables the Netty resource leak detector early in initialization and you need to use a mixin to make it not do that. I've fixed this and it identified the leak straight away. Working on a fix.
Resolved in bcde156, will release 0.1.8 with the fix.