Jump to content
  • Advertisement
Sign in to follow this  
georgepliu

OpenGL iOS OpenGLES memory issue

This topic is 2539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am a novice iOS OpenGLES developer and am working on a app for publication. I noticed in any of the OpenGLES code for the iPhone I've downloaded, compiled, and ran showed a continuous increase in the 'live bytes' and 'total memory' values in the Allocation Instrument of the Instruments app. Memory usage jumps (5 - 10 kb) every time a presentRenderBuffer is called, which can add up pretty fast when frames are refreshed 60 times a second. Any thoughts would be appreciate in advance.

Share this post


Link to post
Share on other sites
Advertisement
I've never had problem with presenting render buffer but I cannot tell this should not happened on different iOS version but I think your problem should be elsewhere
Are you using device or simulator? Sometimes simulator produce some garbage
If you are sure that presenting buffer is problem than you should report bug
But first think I should try is to present render buffer in loop with no other operation (only [myView presentRenderBuffer] ) with break point at end
You should also check for event which calls your render buffer creation
If you are using iOS 5 you should also read about ARC

Share this post


Link to post
Share on other sites
Hidden
Are you by chance creating a new framebuffer each frame accidentally? If you're drawing into a 32 bit pixel format at 480x320, that could account for the 5kb increase you're seeing. I would also try setting the [color=#666666][font=Courier, Consolas, monospace]

kEAGLDrawablePropertyRetainedBacking[/font] property on your EAGLDrawable to NO.

I would agree that presentRenderBuffer is most likely not your problem. It just be might that the presentRenderBuffer triggers a context flush, so you eoulf be seeing the effects of your previous gl* calls as well which means all of your GLES code should be suspect.

Share this post


Link to post
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

Are you by chance creating a new framebuffer each frame accidentally? If you're drawing into a 32 bit pixel format at 480x320, that could account for the 5kb increase you're seeing. I would also try setting the

[/font][color=#666666][font=helvetica, arial, verdana, tahoma, sans-serif]

[font=Courier, Consolas, monospace]

kEAGLDrawablePropertyRetainedBacking[/font]

[/font][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

property on your EAGLDrawable to NO.

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

I would agree that presentRenderBuffer is most likely not your problem. It just be might that the presentRenderBuffer triggers a context flush, so you would be seeing the effects of your previous gl* calls as well -- which means all of your GLES code should be suspect.

[/font]

Share this post


Link to post
Share on other sites
Check that you are not creating new textures and VBOs at each frame. My strategy for these kinds of issues is to divide and conquer. Comment out everything in your render code and then start enabling stuff one by one until the problem presents itself.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!