PaperMC/Folia

Memory Leak | Leaking all entities references?

Closed this issue · 3 comments

Profile link

not necessary

Description of issue

Currently there's a method that used to be called on ticking of entities, trackUnload
This used to be the method called on 1.20.6 and below:
image

which would clear internally on the method, the ref list toPRocessTrackingUnloading.
ON 1.21 and upfront the method was completely forgotten, and you ended up using another ref list, called trackerUnloadedEntities

image

This causes a leak to be present, on every single entity ever loaded by the server.

Plugin and Datapack List

{}

Server config files

no need for htis

Folia version

cloned from head.

Other

none

I totally agree with you. I have this problem with 1.21.1. I never had this problem with 1.20.4. I migrated my server to 1.21.1 and my server is essentially a vanilla server that aims for high entity without compromising on the experience. I use the same plugins but with the latest version 1.21.1 I can't keep my server up for more than 7-8 hours because all my ram is empty and I have to restart the server.
image
Iron golems are spawning on my server because there are so many farms, but none of them are cleared by ram even after they die! Not only iron golems, but all farms with high mob spawns cause memory leaks on the server, and when I dump, only mob entities appear.