Memory Leak

I’ve been using OpenGL for awhile now, but just recently I discovered some of my programs are having a memory increase of about 4-8K every second.

I did some test where I created just a window with only glClear(…) and SwapBuffers(), and it’ll have the leak.

Anyone have any ideas why this is happening? Btw, my graphic card is Nvidia 7950 with the latest driver. However I don’t think it is card issue.

What API are you using? GLUT, Windows API?
Perhaps you do not release some GDI object after every paint operation.

Actully it is with both GLUT and Win32, both have the same problem.

I did some search online, and found few others had the same problem, all somewhat traced back to glClear().

I’m still looking for why this is happening…

In taht case it would be a driver bug. Or it may not be a bug. Maybe teh driver allocates soem mem for it’s needs and will deallocate it after reaching some limit. Why won’t you try some third-party opengl applications and watch them in the task manager?

If you are using the windows task manager to check for memory leaks, the values it reports are often wrong.

Use Process Explorer:
http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx

Double click on a process, Select the “Performance” tab and check if the “Private bytes” are increasing.