Fabric API

Fabric API

108M Downloads

fabric-lifecycle-events-v1 is slowly leaking memory

ishland opened this issue ยท 3 comments

commented

private final Set<WorldChunk> loadedChunks = new HashSet<>();

This HashSet is storing many unloaded chunks, causing it to run into OutOfMemoryError and crash the server with a high playercount and loading many chunks.
I can provide heap dumps if necessary.

commented

I think it would be fairer if you informed people that you are involved with this mod:
https://github.com/ishlandbukkit/C2ME-fabric
and declared whether that mod is in play here.

That HashSet is never going to work properly with multi-threaded chunk loading.
HashSets just aren't thread safe.

You also redirect the unloading of chunks here:
https://github.com/ishlandbukkit/C2ME-fabric/blob/ver/1.17/src/main/java/com/ishland/c2me/mixin/chunkscheduling/fix_unload/MixinThreadedAnvilChunkStorage.java
Is the method with the Fabric API mixin to maintain that HashSet still called?

commented

Yes, id like to see some proof of this issue (a heap dump) without any other mods installed.

commented

From further investigation, the memory leak and crash were caused by another custom mod. Sorry for wasting your time.

I think it would be fairer if you informed people that you are involved with this mod:
https://github.com/ishlandbukkit/C2ME-fabric
and declared whether that mod is in play here.

C2ME isn't installed on the production server that crashed as it isn't production ready.