Hello,
I’ve been working on a project with this library and have encountered a significant issue with memory usage. Even in a basic application, the memory footprint seems to be expanding considerably. Upon investigation, I suspect the problem lies in the frequent object instantiation within the game loop, like Vector2 and Rectangle used in the DrawTexture functions. These objects are being created anew in each frame, which could be leading to the increased memory usage.
Does anyone have a workaround or a solution to mitigate this memory growth?
I thought about using Memory Stack, but it only works for primitive types, which would involve significantly changing the source code, or using object pooling, but I don't know if it would be a good idea.
Hello,
I’ve been working on a project with this library and have encountered a significant issue with memory usage. Even in a basic application, the memory footprint seems to be expanding considerably. Upon investigation, I suspect the problem lies in the frequent object instantiation within the game loop, like
Vector2andRectangleused in the DrawTexture functions. These objects are being created anew in each frame, which could be leading to the increased memory usage.Does anyone have a workaround or a solution to mitigate this memory growth?
I thought about using Memory Stack, but it only works for primitive types, which would involve significantly changing the source code, or using object pooling, but I don't know if it would be a good idea.