Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Svampen |
I’m trying to learn C# by using godot and i’m trying to write a 2D fov algorithm.
However i noticed that the static memory usage and amount of objects in memory skyrockets using the debugger monitor so i wrote a simple memory test to try to figure out how it works.
Example:
private void MemoryTest() { Polygon2D polygon = new Polygon2D(); }
Always results in a new Polygon2D object without getting rid of the reference to the old one so the amount of objects in memory constantly increase.
When using a native c# object such as a List the automatic garbage collection takes care of it and the memory usage remains the same.
I’m trying to get rid of the godot object from memory by using the method Dispose() but it doesn’t work.
What am i missing?
Thanks!