Clear Video Card Memory

I have a Qt application I have created that displays a couple different windows each containing a different OpenGL plot that can be panned, zoomed in/out, as well as other things. I have had a problem that after I render the scene enough times, or bring a window to obscure my scene and then cause my screen to come back to the front, that my drawing suddenly slows down. I thought this might be a Qt issue but I couldn’t find a fix for it. A friend suggested I set my OpenGL calls to be single buffered to see if I fill up me video card memory. He said if I saw every step of the drawing process occur in order and not all at once like a swapBuffers call would generate that I had filled up my video card memory and was using system memory to render my scene. He was right, after a few renders, I was watching my scene render from start to end, taking a couple minutes. Most of my plots contain approximately 5000 glBitmaps and 30-50 glLines. I can see each bitmap pop up on the screen followed by each line drawing. Is there a way to try and clear my video card memory to see if this fixes my problem? I am on a Sun V880 server running Sun OS 9 and containing 4 XVR-100 video cards each running one monitor. This slowdown occurs if I limit my program to run on one monitor or send it out to all 4 monitors. We currently have OpenGL version 1.3 running on the system. I believe Sun has released version 1.5 but have not looked into this yet or know if this would fix our problem. Any ideas on how to fix this problem would be greatly appreciated. Thanks!!

It is very probably that you don’t free some resources while rendering. You cannot “free” GL memory, it is occupied by objects(textures, VBOs etc) and it freed when this are deleted. It doesn’t have be GL resources, maybe you allocate bitmap data each frame but don’t free it, running out of system memory. You should look for such places in you program. Of course this also may be a driver bug :slight_smile:

It could be that I am not freeing bitmap data but I am actually unsure how this should be done. I have an array that contains 63 Symbol structs. I have 63 different .h files containing different XBMs. They #define a width and height and then declare the bits into an array. So accessing my data works like:

Symbols[x].width gets the width of the image
Symbols[x].height gets the height of the image
Symbols[x].bits gets the data for the image

Whenever I draw my 5000 bitmaps I just set my glRasterPos3d( ) and then call glBitmap( ). Is there something I should be freeing up somewhere? I don’t use any textures or VBOs and I knew those used memory and stayed there until deleted but I didn’t know what else might use video card memory. So is there something I should be deleting or freeing after making my glBitmap( ) call? Thanks for your help again!

Edit: Instead of making 5000 glBitmap calls every redraw would it be better if I just created 63 display lists and then made 5000 calls to display lists? But if I need to use the same bitmap but in different colors, then would display lists be as useful? I am thinking I would have to create a display list for each bitmap for each color. Is this right? Thanks!

I created the 63 different display lists and call glDeleteLists( ) in my destructor but to no avail, after redrawing the data ~15-20 times, the slow down continued to work in the same manner as before. I think my next step is to update to OpenGL 1.5 and update the drivers. Any other ideas would be greatly appreciated. Thanks!

I have never worked with Sun, but this seems like a driver bug to me. If you allocate no memory or other resources in your program, the guilt has to lie elsewhere…