(1.12) Memory Leak: EntityBenderRegistry#entityToBenderMap
Meldexun opened this issue ยท 0 comments
Describe the bug
Entries of the map EntityBenderRegistry#entityToBenderMap
use entity instances as their keys which creates a memory leak. There are some methods for clearing the map but they only seem to be called when the config has changed or the refresh hotkey is used.
Aside from that I'm not sure why that map exists in the first place. I have looked at the class a bit and to me it seems that the entityClassToBenderMap
should be enough and the entityToBenderMap
is just rendundant.
This also looks very similar to the RenderManager#entityRenderMap
from vanilla which can be accessed with RenderManager#getEntityClassRenderObject(Class<? extends Entity>)
. I think doing something similar here would be a good solution.
To Reproduce
Steps to reproduce the behavior:
- Join a world
- Leave the world
- See WorldClient instance not being garbage collected
Context (please complete the following information):
- Minecraft version: 1.12.2
- Forge version: 14.23.5.2855
- Mo' Bends version: 1.1.0