glDrawElements allocating memory and not releasing it

Posted by Joshua Weinberg on Stack Overflow See other posts from Stack Overflow or by Joshua Weinberg
Published on 2009-12-09T07:39:40Z Indexed on 2010/06/18 15:13 UTC
Read the original article Hit count: 284

Using OpenGLES 1.1 on the iPhone 3G (device, not simulator), I do normal drawing fun. But at points during the run of the application I get giant memory spikes, after a lot of digging with instruments I have found that it is glDrawElements that is grabbing the memory.

The buffer being allocated is 4 meg, which to me means its loading a texture into RAM, which I guess could be valid, but its never releasing this buffer, and is allocating multiple of them.

How do I make sure that these buffers that GL is creating get destroyed, instead of just hanging around?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c