여러 Bitmap 객체를 만들고이를 사용하여 BitmapDrawables를 만드는 복잡한 응용 프로그램이 있습니다. 이것이 대답하기 어려운 질문 일 수도 있지만, 올바른 방향으로 나를 가리켜 주면 도움이 될 것입니다. 나는 메모리 할당에 관한 테스트를 해왔고, 거의 빈손으로 나왔다. 이걸 일으킬 수있는 것에 대한 아이디어가 있습니까?IllegalArgumentException Surface.nativeLockCanvas, Choreographer, BufferQueue
LOG :
04-29 12:48:00.442: E/BufferQueue(177): [com.example.app/com.example.app.Activity_One] queueBuffer: fence is NULL
04-29 12:48:00.442: E/Surface(2154): queueBuffer: error queuing buffer to SurfaceTexture, -22
04-29 12:48:00.442: W/Adreno-EGLSUB(2154): <SwapBuffers:1374>: failed to queueBuffer
04-29 12:48:00.442: W/Adreno-EGL(2154): <qeglDrvAPI_eglSwapBuffers:3654>: EGL_BAD_SURFACE
04-29 12:48:04.486: W/Adreno-EGLSUB(2154): <DequeueBuffer:606>: dequeue native buffer fail: Unknown error 2147483646, buffer=0x0, handle=0x0
04-29 12:48:04.486: E/BufferQueue(177): [com.example.app/com.example.app.Activity_One] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count
04-29 12:48:04.486: W/Adreno-EGLSUB(2154): <DequeueBuffer:606>: dequeue native buffer fail: Invalid argument, buffer=0x0, handle=0x0
04-29 12:48:04.486: W/Adreno-ES20(2154): <gl2_surface_swap:43>: GL_OUT_OF_MEMORY
04-29 12:48:04.486: W/Adreno-EGL(2154): <qeglDrvAPI_eglSwapBuffers:3597>: EGL_BAD_SURFACE
04-29 12:48:04.486: W/HardwareRenderer(2154): EGL error: EGL_BAD_SURFACE
04-29 12:48:04.506: W/HardwareRenderer(2154): Mountain View, we've had a problem here. Switching back to software rendering.
04-29 12:48:08.440: E/Surface(2154): dequeueBuffer failed (Unknown error 2147483646)
04-29 12:48:08.480: E/ViewRootImpl(2154): Could not lock surface
04-29 12:48:08.480: E/ViewRootImpl(2154): java.lang.IllegalArgumentException
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.Surface.nativeLockCanvas(Native Method)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.Surface.lockCanvas(Surface.java:243)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.Choreographer.doFrame(Choreographer.java:544)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.os.Handler.handleCallback(Handler.java:733)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.os.Handler.dispatchMessage(Handler.java:95)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.os.Looper.loop(Looper.java:136)
04-29 12:48:08.480: E/ViewRootImpl(2154): at android.app.ActivityThread.main(ActivityThread.java:5017)
04-29 12:48:08.480: E/ViewRootImpl(2154): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 12:48:08.480: E/ViewRootImpl(2154): at java.lang.reflect.Method.invoke(Method.java:515)
04-29 12:48:08.480: E/ViewRootImpl(2154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-29 12:48:08.480: E/ViewRootImpl(2154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-29 12:48:08.480: E/ViewRootImpl(2154): at dalvik.system.NativeStart.main(Native Method)
04-29 12:48:09.441: E/BufferQueue(177): [com.example.app/com.example.app.Activity_One] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count
04-29 12:48:09.441: E/Surface(2154): dequeueBuffer failed (Invalid argument)
04-29 12:48:09.461: E/ViewRootImpl(2154): Could not lock surface
04-29 12:48:09.461: E/ViewRootImpl(2154): java.lang.IllegalArgumentException
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.Surface.nativeLockCanvas(Native Method)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.Surface.lockCanvas(Surface.java:243)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.Choreographer.doFrame(Choreographer.java:544)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.os.Handler.handleCallback(Handler.java:733)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.os.Handler.dispatchMessage(Handler.java:95)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.os.Looper.loop(Looper.java:136)
04-29 12:48:09.461: E/ViewRootImpl(2154): at android.app.ActivityThread.main(ActivityThread.java:5017)
04-29 12:48:09.461: E/ViewRootImpl(2154): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 12:48:09.461: E/ViewRootImpl(2154): at java.lang.reflect.Method.invoke(Method.java:515)
04-29 12:48:09.461: E/ViewRootImpl(2154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-29 12:48:09.461: E/ViewRootImpl(2154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-29 12:48:09.461: E/ViewRootImpl(2154): at dalvik.system.NativeStart.main(Native Method)
04-29 12:48:09.761: E/BufferQueue(177): [com.example.app/com.example.app.Activity_One] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count
…
메모리가 부족합니다. 첫 번째 몇 줄의 로그에 오류가 있습니다. BufferQueue가 버퍼를 대기열에 넣으려는 요청을 거부하고 잘못된 상태가되고 있습니다. 따라서 버퍼는 여전히 공식적으로 "체크 아웃"되고 lockCanvas()가 다른 큐를 큐에서 제거하려고 시도하면 BufferQueue는 no를 말합니다. 근본적인 원인은 NULL 차단이 queueBuffer()에 전달되는 것 같습니다. 무엇이 그 원인이 될지 확실하지 않습니다. – fadden
고마워요 @fadden ... [울타리가있을 수도있는 곳] [Here 's] (https://android.googlesource.com/platform/frameworks/native/+/708cc79/libs/gui/BufferQueue.cpp) 이걸 사냥하고있어. – ChrisVollo
내가 사용하고있는 Android 또는 기기의 버전과 관련이 있는지 궁금합니다. 기기 및 Android 버전을 전환했으며 문제를 재현하지 못했습니다. – ChrisVollo