Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
The IImageBuffer CapeUtils$1 keeps hold of player objects after it is done with them. This causes every player you have seen who has an optifine cape to be kept in memory forever.
When playing on minigames servers with constant world changes this also causes many worlds to be kept in memory.
As an example, after playing hypixel for about two hours my game was at 90% memory usage, causing unplayable gc spikes.
Suggested fix: instead of using a final player in the anonymous class, use the player's name to find the relevant player in the world's player list.