keii
keii
Explore posts from servers
CC#
Created by keii on 8/8/2023 in #help
Do static classes leak memory?
I have made a simple 2d game engine currently built on SDL2 to work on the api and such. What i've noticed is that the game engine is leaking loads of memory (around 2 mb a second) and i'm trying to figure out why. Now the entire game engine is composed of static classes so that you can do calls like Draw.Rectangle(x, y, w, h) and likewise to ease the learning curve and Draw.Rectangle adds a class to a list which is drawn and cleared every frame. Do static classes not clear memory or something similar or do i have another problem? I have checked the rider memory debugger and it says that the Rectangle class takes up around 255 kb which should not be happening.
28 replies