I have an OpenGL program under Windows (2000/XP). It redraws to the screen @ 30 frames per second (fps). When the redraws include line drawing (GL_LINES or GL_LINE_STRIP and glVertex3f) of up to several thousand lines each.
I see the memory allocated for the program increasing approximately 4KB every few seconds. After several hours of operation, this can add up to lots of megabytes. Yet if the program is minimized and then restored, the extra memory allocated is freed. The memory allocation then begins again.
The memory loss does not occur if not drawing lines (commented out the glVertex3f calls).
As this program may run for several weeks unattended, the memory loss can get to be critical long before the program will have finished.
This memory loss happens under different video cards with different chipsets. It occurs under both Windows 2000 and Windows XP.
Where is the memory loss coming from? Why is it happening? And what can be done to eliminate it, short of turning the program into a completely Windows GDI/GUI program?