Memory leakage caused by scene load from file

Godot 4.1.3.stable.mono

I seem to have caught a memory leak issue that persists throughout my whole project after scene_load_from_file. Unsure if this is just a project or the engine itself, but I know 100% it isn’t my code causing this issue. Some obvious indicators are the objects graph, progressively growing each scene load from file. Including the slight increase in memory.

If you believe this to be a bug in Godot, you should report this at Issues · godotengine/godot · GitHub.

That said, I was unable to reproduce this myself.

I assume by scene_load_from_file you’re referring to get_tree().change_scene_to_file?

Are you able to narrow down the cause to a specific script or scene? Does it happen with a fresh, nearly empty scene?

change_scene_to_file, that’s correct. This issue really is focused on a certain nodes that seem to duplicate, which as a result, could print from those duplicates through GD.Print, but certain data would just return null (because the duplicate is not valid, therefore will return null). So I have these stray scripts/nodes that aren’t even considered as orphans, but still retain their somewhat zombified existance, and the only temporary solution is to use my object tracker to get the current instance of the non duplicate node. However that doesn’t completely remove the other “zombie nodes/scripts”

It would be helpful if you could provide a small sample project which demonstrates the issue.

I’ll see if I can isolate my assets for you, will have to set that up