Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak of MinecraftServer #1336

Closed
pietro-lopes opened this issue Aug 23, 2024 · 1 comment
Closed

Memory Leak of MinecraftServer #1336

pietro-lopes opened this issue Aug 23, 2024 · 1 comment
Labels
Bug Fixed in Dev Issue will be closed after next release

Comments

@pietro-lopes
Copy link

Describe the bug

This memory leak is caused by not unregistering the DroneEntity from event SemiblockEvent when entity leave the level.

How to reproduce the bug

Join a world, summon any drone, leave world, join again and server is leaked in memory.

Expected behavior

Should unregister by storing a local variable holding the consumer, registering via consumer and unregistering via object does NOT match and fails to unregister.

Registering via Consumer

NeoForge.EVENT_BUS.addListener(this::onSemiblockEvent);

But trying to unregister via object (not only those cases, look for more)


Also trying to unregister on die might not include when single players leave world.
You might want to override onRemovedFromLevel or whatever you choose is the best for your case.

Additional details

image

Which Minecraft version are you using?

1.21

Which version of PneumaticCraft: Repressurized are you using?

8.0.3

Crash log

No response

@desht desht added the Fixed in Dev Issue will be closed after next release label Aug 27, 2024
desht added a commit that referenced this issue Aug 27, 2024
Ensure event listener is correctly cleared down when entity is removed
Also, now only registering the semiblock listener if the drone has
  a Logistics progwidget (otherwise drone simply doesn't care)

#1336
@desht
Copy link
Member

desht commented Aug 31, 2024

Fixed in 8.1.1

@desht desht closed this as completed Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fixed in Dev Issue will be closed after next release
Projects
None yet
Development

No branches or pull requests

2 participants