Toggling Visibility of a MeshInstance Causes Huge Memory Leak??

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By qdeanc

I have a script where I generate some MeshInstance’s when _ready() is called.
In the same script, _process() toggles the visibility of all the MeshInstances on every update.

When I play the game, the Static Memory constantly, indefinitely, and permanently increases!


More details:
+No other memory monitor stats increase.
+Letting it run for an hour resulted in the Godot using 16GB of memory (and climbing).
+Freeing all MeshInstance objects from memory does not lower the Static Memory usage.
+Toggling visibility every second instead of every frame yields the same results, but with a slower increase in Static Memory.


Here is my project file. Please help!

Can You please paste this script here instead ?

Inces | 2022-02-03 17:03

:bust_in_silhouette: Reply From: qdeanc

Turns out this was a bug; I opened an issue on the godotengine github and it has already been resolved!

Click here for more details:

The issue is only present when having “Use Bvh” on in the Rendering settings.