Memory leak when open GUI, like CraftingTable, Anvil and anything else with ScreenHandlers, also items with GUI, like BookEditScreen. ScreenHandlers and Screens are stacking in the Heap.
Expected Behaviour
Screens and ScreenHandlers instances are removed by GC after GUIs closed.
Screenshots
Opened 20 times, got 20 instances. Without this mod I never have more than 1
Reproduction Steps
Mods: Fabric Api 0.87.0+1.20.1, YetAnotherConfigLib 3.1.0+1.20, Controlify 1.6.0+1.20. Fabric Loader version 0.14.22
Create a new world or load one
Place or take something with GUI, in my case this is Anvil, which extends BlockEntity
Open and close the placed Anvil GUI multiple times
Take a Heap dump or attach a debugger (I used VisualVM 2.1.6 for a Heap Dump)
Search for a screen class in Class Filter, for AnvilScreen it is class_471, ForgingScreenHandler is class_4861 and AnvilScreenHandler is class_1706, they are leaking altogether
You can see a lot of class instances with references to dev.isxander.controlify.screenop.compat.vanilla.AbstractContainerScreenProcessor and dev.isxander.controlify.screenop.ScreenProcessor
Logs
No response
Mod Version
1.6.0+1.20
Controller
nothing
Bluetooth
[ ] Yes
Operating System
Windows
ARM
[ ] Yes
Additional Information
Maybe you should nullify references in Screens and ScreenHandlers in onClose to make GC working? Just assuming, I don't know how does your mod working
No controllers at all, I just used Fabulously Optimised 5.3.0-beta4 which has this mod included. Disabling Controlify mod resolves this leak.
Just to make sure...
[X] I have made sure I am using the latest version of Controlify for the latest version of Minecraft.
[X] I have made sure there are no other issues describing the same problem on the issue tracker.
Current Behaviour
Memory leak when open GUI, like CraftingTable, Anvil and anything else with
ScreenHandler
s, also items with GUI, likeBookEditScreen
.ScreenHandler
s andScreen
s are stacking in the Heap.Expected Behaviour
Screen
s andScreenHandler
s instances are removed by GC after GUIs closed.Screenshots
Opened 20 times, got 20 instances. Without this mod I never have more than 1
Reproduction Steps
Fabric Api 0.87.0+1.20.1
,YetAnotherConfigLib 3.1.0+1.20
,Controlify 1.6.0+1.20
. Fabric Loader version0.14.22
BlockEntity
Class Filter
, for AnvilScreen it isclass_471
, ForgingScreenHandler isclass_4861
and AnvilScreenHandler isclass_1706
, they are leaking altogetherdev.isxander.controlify.screenop.compat.vanilla.AbstractContainerScreenProcessor
anddev.isxander.controlify.screenop.ScreenProcessor
Logs
No response
Mod Version
1.6.0+1.20
Controller
nothing
Bluetooth
Operating System
Windows
ARM
Additional Information
Maybe you should nullify references in Screens and ScreenHandlers in
onClose
to make GC working? Just assuming, I don't know how does your mod workingNo controllers at all, I just used Fabulously Optimised 5.3.0-beta4 which has this mod included. Disabling Controlify mod resolves this leak.
Just to make sure...