i was writing a game in sdl2 (and lua 5.2 for modding). while i was trying to optimize the game i minimized the window, i saw the memory multiply in windows task manager then my computer froze. after restarting my computer, i went to a program i made a few days ago. i minimized the window and there was not memory overflow.
Unfortunately the 'cause' and the problem do not seem to be related, so it could really be any number of things. A lot more information about your program is going to be necessary to figure out the answer to this problem.
I doubt it, but this problem will likely be nigh impossible to diagnose without me reading and understanding your entire program. You may want to consider running your program in a debug mode or something so you can catch an out of memory error and see what the program is doing at that point, as I'd expect it is probably a lot of the same allocation request in a loop or something that is causing the problem.
well after some diagnostics i figured out that i was rending the whole time. well when you would minimize the screen there is nothing to render to. so it causes a memory overflow. to counter this, i put the render function into a statement testing for if the window is minimized. if it is minimized don't render! one thing i can't seem to figure out is why it goes up in cpu when minimized. i don't care about cpu going up when minimized i just don't want the users computer crashing because of my program.
i put the render function into a statement testing for if the window is minimized.
And OP said:
i can't seem to figure out is why it goes up in cpu when minimized.
My crystal ball tells me that these two things may be related somehow. You are better off capturing the system messages to the window and keeping track of it's state that way. You need someway to defer CPU time from your program when it is minimized. Unfortunately I have spent too much time away from SDL to remember what the equivalent of SFML's sf::Window::waitEvent() is.