iDevGames Forums
Why Does OpenGLES Appear To Leak Memory? - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Why Does OpenGLES Appear To Leak Memory? (/thread-659.html)

Why Does OpenGLES Appear To Leak Memory? - muleskinner - Oct 21, 2009 03:57 AM


I'm doing some performance checking on my app using Instruments and I'm getting what appears to be memory leaks deep in Apple's GL code.

By a 'memory leak' I mean the net space taken up by block of memory in instruments appears to keep increasing all the time just as my app is running.

Is this normal? It doesn't look good to me!

The offending parts of code appear to be:

10 MyApp -[EAGLView drawView] /Volumes/Docs/development/iPhone/Trivia/../MEAT/Classes/apple/EAGLView.m:107
   9 OpenGLES glAlphaFuncx
   8  0x1af2e0
   7  0x1a5a24
   6  0x1a50b0
   5  0x1a4ec4
   4  0x1ccd38
   3  0x1af25c
   2 QuartzCore native_window_begin(_EAGLNativeWindowObject*)
   1 QuartzCore CAImageQueueCollect
   0 QuartzCore release_image(_CAImageQueue*, unsigned long, CAImageQueueReleased*)


18 MyApp main /Volumes/Docs/development/iPhone/Trivia/main.m:14
  17 UIKit UIApplicationMain
  16 UIKit -[UIApplication _run]
  15 CoreFoundation CFRunLoopRunInMode
  14 CoreFoundation CFRunLoopRunSpecific
  13 CoreFoundation __CFRunLoopDoObservers
  12 QuartzCore CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
  11 QuartzCore CA::Transaction::commit()
  10 QuartzCore CA::Context::commit_transaction(CA::Transaction*)
   9 QuartzCore CALayerLayoutIfNeeded
   8 QuartzCore -[CALayer layoutSublayers]
   7 UIKit -[UIView(CALayerDelegate) _layoutSublayersOfLayer:]
   6 MyApp -[EAGLView layoutSubviews] /Volumes/Docs/development/iPhone/Trivia/../MEAT/Classes/apple/EAGLView.m:114
   5 MyApp -[EAGLView createFramebuffer] /Volumes/Docs/development/iPhone/Trivia/../MEAT/Classes/apple/EAGLView.m:126
   4 OpenGLES glAlphaFuncx
   3  0x1af48c
   2  0x1af25c
   1 QuartzCore native_window_begin(_EAGLNativeWindowObject*)
   0 QuartzCore x_list_prepend_

Any help appreciated.

Why Does OpenGLES Appear To Leak Memory? - Frogblast - Oct 21, 2009 05:57 PM

This is a bug in the gathering of malloc data. There is no actual leak.

Why Does OpenGLES Appear To Leak Memory? - muleskinner - Oct 22, 2009 04:54 AM

Great - thanks!