I have been having some problems with my openGL application running out of memory and I am trying to track down my problem. To this end, I created a small test program that bas
Also, since your error has the GLU prefix, could you try running the same program without building mipmaps?[already done] I don't think GLU_OUT_OF_MEMORY
necessarily means that you are out of GPU memory (in fact the mipmaps are probably built on the CPU), so maybe you are suffering from Heap fragmentation. The fact that you get the error on different Windows machines with very different GPUs seems to indicate that it's not a specific OpenGL driver problem; they are too different across vendors.
Since you are using a large texture, and if not using gluBuild2DMipmaps
doesn't solve the problem, you could pre-allocate the GPU memory for your large texture(s) once when your app starts and reuse the texture objects with glTexSubImage
instead of creating new ones on reload.
Since you get GLU_OUT_OF_MEMORY
and not GL_OUT_OF_MEMORY
I assume the problem occurs during mipmap creation with gluBuild2DMipmaps
. Since maybe the glu function is at fault, perhaps you could try building your mipmaps in an offline process and then simply load them in Create-texture-from-file. Besides potentially solving your out of memory error, this would let you have much better control over the actual mipmap generation. You could for example use a gaussian filter instead of a box filter. It would also ensure identical mipmap content across platforms. My understanding is that this is how mipmaps are usually handled.