SDL2 Memory Usage

Hi there and thanks for your time. I’ve been working on a game project for a while now, and I just noticed that the baseline memory usage for the program is rather high. It’s using about 58mb of ram according to task manager if I remove basically everything from my game except initializing SDL2 and creating an OpenGL context and flipping a blank window. I know 58mb isn’t all that much, but I prefer to keep it down as much as possible. Especially since the game will require quite a bit.

I am using some other libs like sdl2_image, sdl2_ttf. I did recompile sdl2_ttf from source to use the latest version of FreeType. The last program I made with the same setup was using much less memory. I think it was the older version of SDL. Is it normal for SDL2 to use this much memory? Am I doing something wrong, or is there anything I can do to reduce the memory footprint? I’m compiling with MSVC 10 express on Windows 7. I’ve experimented with the compilation options and optimizations, that doesn’t seem to make much difference. Again thanks for your time.

I figured out what the problem was. I was debugging a memory leak a while back and had the “enable page heap” flag turned on for the application in the registry. I didn’t realize that increased the memory usage.

“PageHeap enables Windows features that reserve memory at the boundary of each allocation to detect attempts to access memory beyond the allocation.”

I’m glad I got it worked out. Memory usage is down to around 10MB with all the textures loaded and everything.

I apologize for the mix up.