team-abnormals / blueprint

Library that implements the framework of all Abnormals mods
https://www.curseforge.com/minecraft/mc-mods/blueprint
Other
111 stars 34 forks source link

Clear SelectionSpace reference from ObjectModificationManager after reload #195

Closed embeddedt closed 1 year ago

embeddedt commented 1 year ago

I discovered this memory leak by profiling FTB Skies. From what I can tell the selectionSpace object is not needed after apply finishes, so it can be simply be reset to the default empty function. Doing this can save at least 60MB in larger modpacks, as this object ends up retaining JSON objects that the game would otherwise have freed.

SmellyModder commented 9 months ago

@embeddedt Just a heads up since I noticed you've included a fix for this issue in Modern Fix. A release for Blueprint on 1.19.2 now exists with this fix, and all versions of Blueprint 1.20+ include the fix. Blueprint also doesn't exist on 1.19.3 and 1.19.4. You do not need to include the fix on those versions anymore.