MineColonies

MineColonies

59M Downloads

Memory Leak of Client Level

pietro-lopes opened this issue ยท 1 comments

commented

Is there an existing issue for this?

  • I have searched the existing issues.

Are you using the latest MineColonies Version?

  • I am running the latest beta/release version of MineColonies for my Minecraft version.
    I am also running the latest versions of other mods that are part of my problem.

Did you check on the Wiki? or ask on Discord?

  • I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.

What were you playing at the time? Were you able to reproduce it in both settings?

  • Single Player
  • Multi Player

Minecraft Version

1.21

MineColonies Version

1.1.719

Structurize Version

1.0.752

Related Mods and their Versions

JEI - 19.19.3.226

Current Behavior

To add JEI Compat, Minecolonies instantiate Citizens with the current real ClientLevel, causing it to hold forever.

image

Expected Behavior

Maybe implement some sort of fake level or grab the level/instantiate lazily? dunno.

Reproduction Steps

  1. Load world with JEI in the mod list
  2. Change dimensions
  3. Check memory for active ClientLevels, you might see at least 2. the old and the current.

Logs

check image

Anything else?

No response

Footer


Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.
commented

Possible solution: create static fakeLevel for all job cats (from latest blockui), reimplement realLevel() method with mc.instance.level, properly setup entities - might need some changes in fakeLevel because currently it has only setEntities(collection)
I don't recommend using Entity#setLevel nor linking entities with normal level instance (as we do now..)