Skip to content

[Memory-opti:fix leak] Properly use client / common proxies to fix 5 memory leaks#97

Merged
Alexdoru merged 27 commits into
masterfrom
alex/fix-leak
Apr 25, 2026
Merged

[Memory-opti:fix leak] Properly use client / common proxies to fix 5 memory leaks#97
Alexdoru merged 27 commits into
masterfrom
alex/fix-leak

Conversation

@Alexdoru
Copy link
Copy Markdown
Member

See commit history, mostly made the fields of the event handlers non static and accessed via an instance in the common or server proxy. Said instance is set to null when appropriate to prevent memory leaks e.g. when server stops or when client disconnects.

Fix memory leaks :

  • from shield renderer static Map<EntityPlayer, DataUtils.XZPair<Float, Integer>>
  • from TileDislocatorInhibitor static final HashMap<World, HashSet<TileDislocatorInhibitor>>, this one caused a giant memory leak because everytime you change dimensions, it will keep all the previous WorldClient until your game runs out of memory (Memory Leak/Crash every time I change dimensions GT-New-Horizons-Modpack#19536 (comment))
  • from CustomArmorHandler static Map<EntityPlayer, Boolean>
  • from DragonChunkLoader static Map<EntityChaosGuardian, Ticket>
  • from ParticleHandler#theWorld

Bug fix :

  • fix players keeping hill step when removing draconic armor

Screenshot of what your heap looks like after changing dimension multiple times while using magnet inhibitors :
image

@Alexdoru Alexdoru marked this pull request as draft April 19, 2026 12:06
@Alexdoru Alexdoru marked this pull request as ready for review April 19, 2026 13:50
@Alexdoru Alexdoru requested a review from a team April 19, 2026 13:54
# Conflicts:
#	src/main/java/com/brandon3055/draconicevolution/client/ClientProxy.java
@Alexdoru Alexdoru requested a review from Kogepan229 April 25, 2026 16:36
Copy link
Copy Markdown
Member

@Kogepan229 Kogepan229 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alexdoru Alexdoru merged commit c067e59 into master Apr 25, 2026
1 check passed
@Alexdoru Alexdoru deleted the alex/fix-leak branch April 25, 2026 16:58
@Alexdoru Alexdoru changed the title Properly use client / common proxies to fix memory leaks [Memory-opti:fix leak] Properly use client / common proxies to fix 5 memory leaks Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants