抛出异常java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC

这个异常也是别人玩我的游戏的过程中抛出的,我自己是没有重现它,所以不知道具体的步骤。 只是想问问有没有人也遇到过这个问题,同时有没有什么好的解决方案。
异常栈:
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at com.zlimits.suishenbb.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1214)
at com.zlimits.suishenbb.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1172)
at com.zlimits.suishenbb.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1575)
at com.zlimits.suishenbb.GLSurfaceView$GLThread.run(GLSurfaceView.java:1312)

查了一下http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=1418&sid=1a1b527eb8fed303c413bf48840b025f&start=40,有个人这么说的,我没看懂:

by makush » Wed Nov 30, 2011 3:37 pm
pmalolepsy wrote:How did you do that? Did you have to create a custom libgdx build?
I removed gdx-backend-android.jar from my Android sub-project and unzipped in gdx-backend-android-sources.jar. There is createGLSurfaceView method in AndroidGraphics, which chooses the rendering view. In plain LibGDX it creates GLSurfaceViewCupcake only for API 4 and below to workaround rendering problems with GLSurfaceView in API 3-4 (DefaultGLSurfaceView extends from GLSurfaceView). My current assumption is that not only GLSurfaceView in API 3-4 is bugged, but we need to replace it also for API 5-10. Hopefully someone is able to tell if I am on right tracks.
If I understood correctly AndEngine framework uses custom SurfaceView only instead of GLSurfaceView, thus, it does suffer from this crash

造成这个原因很多的,有可能和内存有关,有时候和其他应用的界面之间切换太快时也会出现。如果找不到复现的路径,基本上无法入手解决吧。

哦哦,那我想法重现一下。 多谢!!!!!!!!

我也遇到同样问题,酷派大神手机,OPPO手机,只要过十关左右,必出现这个问题。
也补crash,就是停在那里不动了。

12-31 09:51:23.607: W/MALI(27013): __egl_mali_post_color_buffer:650: _mali_frame_builder_swap, ret = -1
12-31 09:51:23.607: W/GLThread(27013): eglSwapBuffers failed: EGL_BAD_ALLOC
12-31 09:51:23.628: I/View(27013): Touch up dispatch to org.cocos2dx.lib.Cocos2dxGLSurfaceView{414943b8 VFE… .F…I. 0,0-540,960}, event = MotionEvent { action=ACTION_UP, id=0, x=101.81146, y=757.21124, toolType=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=26151259, downTime=26151186, deviceId=3, source=0x1002 }
12-31 09:51:23.761: D/(27013): Callback 0x5d7e7a9c(0x61191418, 0x61b4b1a8, SL_PLAYEVENT_HEADATEND)
12-31 09:51:23.761: D/(27013): audioPlayer_dispatch_headAtEnd_lockPlay callback
12-31 09:51:24.083: D/(27013): Callback 0x5d7e7a9c(0x61263d58, 0x612cf0e8, SL_PLAYEVENT_HEADATEND)
12-31 09:51:24.083: D/(27013): audioPlayer_dispatch_headAtEnd_lockPlay callback
12-31 09:51:30.392: I/View(27013): Touch down dispatch to org.cocos2dx.lib.Cocos2dxGLSurfaceView{414943b8 VFE… .F…I. 0,0-540,960}, event = MotionEvent { action=ACTION_DOWN, id=0, x=230.57301, y=757.21124, toolType=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=26158014, downTime=26158014, deviceId=3, source=0x1002 }