iOS OpenGL context memory consumption

351 views Asked by At

I have a question regarding OpenGL ES context size. I have two OpenGL contexts running on iPad retina using GLKView. The view is configured to have no depth / stencil / multisampling but only a 32 bit framebuffer. A single buffer takes 12MB (2048*1536*4 bytes). Profiling my application reveals I have 3 IOKit allocations of 12MB plus one allocation of 12MB from Core Animation. I suspect they are all related. My guess is that Core animation caches the resulting frame buffer which explains the one 12MB coming from it.Also, I'm calling deleteDrawable on the GLKView which is hidden, which means that I would have expected a single 12MB buffer from IOKit and maybe another one from Core Animation. Does anyone have any experience with OpenGL memory consumption, how to reduce it and why do I see three IOKit allocations although I have only a single GLView at any given time?

1

There are 1 answers

0
Tark On

I believe that iOS devices use triple buffering internally, which would explain the extra allocations. This was mentioned by John Carmack in an email printed here.