This doesn't sound like a leak, more like a driver optimization where the GPU holds on to a memory block (vertexbuffer, texture, whatever) in case it's needed again. If you run your application for some time does it keep allocating more and more memory until the device eventually run out of memory?
It's an unfortunate fact the the first generation of iPhone 3G doesn't have proper support for vertex buffer objects (VBO), they are exposed by the API but they work in exactly the same way as ordinary software vertex buffers. This means that whenever you call glDrawElements
whatever vertex buffers you've set with glVertexPointer
etc will be copied from system memory to the GPU.
The only way you can "leak" memory to OpenGL is by repeatedly allocate various buffer objects (texture objects, vertex buffer objects, frame buffer objects etc.) and not releasing them, like doing this every frame:
GLuint id;
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(...);
you'll eventually run out of memory. I'm using glDrawElements
on the iPhone 3G myself and I'm not seeing this problem, can you give a small repro code sample?