views:

60

answers:

2

This is my first "game" I'm working on in C++ using OpenGL for graphics and SDL for the application. My code appears to work as I am able to create a functional application window and fully load and draw a texture with the Devil Texture library. The problem arises at runtime. My Memory usage, according to Windows Task Manager, starts at around 13,900 but steadily grows to about 15,000 after 4 minutes or so and then stops. Is this normal? Is Windows Task Manager an inaccurate way of viewing memory?

+2  A: 

Could be some memory leaks in your code, i.e. non freed pointers..etc...

On Linux, I would use Valgrind to check this at runtime. I'm not sure what the equivalent is for Windows. This post should point you in the right direction for finding an equivalent tool

Cheers

DavidM
+1  A: 

If you're doing dynamic memory allocation and deallocation during the execution of your app, it could be that you're fragmenting memory and just need that much to deal with all of the "slop" around the fragmentation.

I've used the MMGR package from http://www.fluidstudios.com/ before to track my memory usage. Basically it allows you to dump great information on all of the allocations in your program, so you can track frame to frame to see what's going on.

Good luck.

dash-tom-bang