mekanism / Mekanism

A mod for Minecraft
MIT License
1.39k stars 531 forks source link

Memory Leak of Client Level #8221

Open pietro-lopes opened 2 months ago

pietro-lopes commented 2 months ago

Issue description

This is kinda of a soft leak, as it refreshes itself when you join another world.

image

Might want to add a cleanup strategy when single players exit world to clear MekanismClient.

Steps to reproduce

  1. Join world
  2. Leave world
  3. Check memory for leaked objects

Minecraft version

1.21.1 (Latest)

NeoForge version

21.1.23

Mekanism version

10.6.7

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

thiakil commented 2 months ago

this should be fixed with https://github.com/mekanism/Mekanism/commit/59645a938d415495461c71b7b529ed546d5338ad

pietro-lopes commented 2 months ago

Does it cover Client player logout?

thiakil commented 2 months ago

It should always have been clearing at that point?

pietro-lopes commented 2 months ago

IIRC, Clone does not trigger at logout. A good rule of thumb is that at main menu, there should be no client level/player, server, etc. instances alive.

thiakil commented 2 months ago

Indeed it would not fire, but the existing reset method should have been firing is what I meant