严重的蜂窝硬件加速内存问题
我目前正在为 honeycomb 创建一个应用程序,但我遇到了严重的问题,我怀疑是 openGL 渲染器使用的内存问题。
情况是我有一个滚动视图,其中包含多个容器视图(可能有点多,比如 20 个);这些容器视图每个都包含 6 个自定义视图,这些视图的图层类型设置为由 this.setLayerType(View.LAYER_TYPE_HARDWARE, null);
加速的硬件(如果我不设置它,所有内容都会呈现混乱)图像丢失或绘制在错误的位置等)。我还有一个显示视频的视频视图。
现在,当我的应用程序被销毁并再次创建(特别是在轮换时)时,应用程序就会死得很可怕,没有任何可调试的错误,除了日志显示大量 GC 和其他有关图形缓冲区内存不足等问题的负载之外。各种东西正在消亡:
08-01 11:59:03.540: ERROR/libEGL(4435): call to OpenGL ES API with no current context (logged once per thread)
08-01 11:59:20.050: WARN/WindowManager(125): Window freeze timeout expired.
08-01 11:59:20.300: ERROR/InputDispatcher(125): channel '40f8bc80 com.android.launcher/com.android.launcher2.Launcher (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-01 11:59:20.300: ERROR/InputDispatcher(125): channel '40f8bc80 com.android.launcher/com.android.launcher2.Launcher (server)' ~ Channel is unrecoverably broken and will be disposed!
08-01 11:59:20.300: INFO/ActivityManager(125): Process com.android.launcher (pid 3723) has died.
08-01 11:59:20.300: INFO/WindowManager(125): WINDOW DIED Window{40f8bc80 com.android.launcher/com.android.launcher2.Launcher paused=false}
08-01 11:59:20.300: WARN/WindowManager(125): Failed looking up window
08-01 11:59:20.300: WARN/WindowManager(125): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@40acdc08 does not exist
08-01 11:59:20.300: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9423)
08-01 11:59:20.300: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9414)
08-01 11:59:20.300: WARN/WindowManager(125): at com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:8153)
08-01 11:59:20.300: WARN/WindowManager(125): at android.os.BinderProxy.sendDeathNotice(Binder.java:385)
08-01 11:59:20.300: WARN/WindowManager(125): at dalvik.system.NativeStart.run(Native Method)
08-01 11:59:20.300: INFO/WindowManager(125): WIN DEATH: null
08-01 11:59:21.460: ERROR/MediaPlayer(4435): stop called in state 1
08-01 11:59:21.460: ERROR/MediaPlayer(4435): error (-38, 0)
08-01 11:59:21.490: INFO/OMXCodec(85): [OMX.Nvidia.h264.decode] AVC profile = 66 (Baseline), level = 13
08-01 11:59:21.490: INFO/OMXCodec(85): [OMX.Nvidia.h264.decode] allocating 10 buffers of size 1566720 on input port
08-01 11:59:21.490: INFO/OMXCodec(85): [OMX.Nvidia.h264.decode] allocating 9 buffers from a native window of size 777600 on output port
08-01 11:59:21.520: INFO/WindowManager(125): WIN DEATH: Window{40bad270 RecentsPanel paused=false}
08-01 11:59:21.520: INFO/ActivityManager(125): Process com.android.systemui (pid 177) has died.
08-01 11:59:21.520: WARN/ActivityManager(125): Scheduling restart of crashed service com.android.systemui/.SystemUIService in 1250ms
08-01 11:59:21.520: ERROR/InputDispatcher(125): channel '40b511d8 NotificationPanel (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-01 11:59:21.520: ERROR/InputDispatcher(125): channel '40b511d8 NotificationPanel (server)' ~ Channel is unrecoverably broken and will be disposed!
08-01 11:59:21.520: INFO/WindowManager(125): WIN DEATH: Window{40b51d98 NotificationPeekWindow paused=false}
08-01 11:59:21.520: INFO/StatusBarManagerService(125): binder died for pkg=com.android.systemui
08-01 11:59:21.520: INFO/WindowManager(125): WIN DEATH: Window{40b58810 StatusBar paused=false}
08-01 11:59:21.530: INFO/ActivityManager(125): Start proc com.android.systemui for restart com.android.systemui: pid=4553 uid=1000 gids={2001, 3003, 3002, 3001}
08-01 11:59:21.530: INFO/WindowManager(125): WIN DEATH: Window{409fd688 InputMethodsPanel paused=false}
08-01 11:59:21.530: INFO/WindowManager(125): WINDOW DIED Window{40b511d8 NotificationPanel paused=false}
08-01 11:59:21.530: WARN/WindowManager(125): Failed looking up window
08-01 11:59:21.530: WARN/WindowManager(125): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@40b50fe8 does not exist
08-01 11:59:21.530: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9423)
08-01 11:59:21.530: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9414)
08-01 11:59:21.530: WARN/WindowManager(125): at com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:8153)
08-01 11:59:21.530: WARN/WindowManager(125): at android.os.BinderProxy.sendDeathNotice(Binder.java:385)
08-01 11:59:21.530: WARN/WindowManager(125): at dalvik.system.NativeStart.run(Native Method)
08-01 11:59:21.530: INFO/WindowManager(125): WIN DEATH: null
08-01 11:59:21.540: WARN/GraphicBufferAllocator(125): alloc(720, 720, 842094169, 00002100, ...) failed -12 (Out of memory)
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Allocated buffers:
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x1c1a08: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x225fd0: 3850.00 KiB | 800 ( 800) x 1232 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x22d198: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2a5250: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2ae858: 5280.00 KiB | 1920 (1920) x 1408 | 4 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3510f0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3b0958: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x40e238: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x41a3c0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x5bfe60: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Total allocated: 12251.38 KB
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Nvidia Gralloc
08-01 11:59:21.540: ERROR/SurfaceFlinger(125): Layer::requestBuffer(this=0x35dab0), index=5, w=720, h=720 failed (Out of memory)
08-01 11:59:21.540: WARN/GraphicBufferAllocator(125): alloc(800, 1232, 1, 00000300, ...) failed -12 (Out of memory)
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Allocated buffers:
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x1c1a08: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x225fd0: 3850.00 KiB | 800 ( 800) x 1232 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x22d198: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2a5250: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2ae858: 5280.00 KiB | 1920 (1920) x 1408 | 4 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3510f0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3b0958: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x40e238: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x41a3c0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x5bfe60: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Total allocated: 12251.38 KB
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Nvidia Gralloc
08-01 11:59:21.540: ERROR/SurfaceFlinger(125): Layer::requestBuffer(this=0x5b8568), index=1, w=800, h=1232 failed (Out of memory)
08-01 11:59:21.560: ERROR/InputDispatcher(125): channel '40f0e030 com.myapp/com.myApp.MyActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-01 11:59:21.560: ERROR/InputDispatcher(125): channel '40f0e030 com.myapp/com.myApp.MyActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-01 11:59:21.560: INFO/WindowManager(125): WINDOW DIED Window{40f0e030 com.myapp/com.myApp.MyActivity paused=false}
08-01 11:59:21.560: WARN/WindowManager(125): Force-removing child win Window{40f21568 SurfaceView paused=false} from container Window{40f0e030 com.myapp/com.myApp.MyActivity paused=false}
08-01 11:59:21.570: WARN/AudioSystem(215): AudioFlinger server died!
08-01 11:59:21.570: WARN/AudioSystem(215): AudioPolicyService server died!
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.audio_flinger' died
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.player' died
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.camera' died
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.audio_policy' died
08-01 11:59:21.570: WARN/IMediaDeathNotifier(125): media server died
08-01 11:59:21.570: WARN/AudioSystem(125): AudioPolicyService server died!
08-01 11:59:21.570: INFO/ActivityManager(125): Process com.myapp (pid 4435) has died.
08-01 11:59:21.570: WARN/WindowManager(125): Failed looking up window
08-01 11:59:21.570: WARN/WindowManager(125): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41041880 does not exist
08-01 11:59:21.570: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9423)
08-01 11:59:21.570: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9414)
08-01 11:59:21.570: WARN/WindowManager(125): at com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:8153)
08-01 11:59:21.570: WARN/WindowManager(125): at android.os.BinderProxy.sendDeathNotice(Binder.java:385)
08-01 11:59:21.570: WARN/WindowManager(125): at dalvik.system.NativeStart.run(Native Method)
08-01 11:59:21.570: INFO/WindowManager(125): WIN DEATH: null
08-01 11:59:21.570: INFO/ActivityManager(125): Start proc com.android.launcher for activity com.android.launcher/com.android.launcher2.Launcher: pid=4559 uid=10025 gids={}
08-01 11:59:21.650: INFO/ActivityThread(4559): Pub com.android.launcher2.settings: com.android.launcher2.LauncherProvider
所以问题是,我怎样才能确保这种情况不会发生?具体来说:
- 我是否需要特别注意缓存等,如何?
- 我是否必须限制硬件加速视图的数量?
Im currently creating an app for honeycomb, but i'm getting significant problems i'm suspecting is with memory used by the openGL renderer.
Situation is i've got a scrollview that holds multiple container views (can be somewhat much, like 20); those container views each consist of like 6 custom views that have their layertype set to hardware accelerated by this.setLayerType(View.LAYER_TYPE_HARDWARE, null);
(if I don't set it everything gets rendered all messed up with images missing or being drawn at wrong places etc). I also have a videoview that shows a video.
Now when I the app gets destroyed and created again (particularly on rotation) the app just dies a seriously horrible death without any debuggable errors except that the logs show a lot of GCs and loads of other stuff concerning graphics buffers being out of memory and all kinds of stuff dying:
08-01 11:59:03.540: ERROR/libEGL(4435): call to OpenGL ES API with no current context (logged once per thread)
08-01 11:59:20.050: WARN/WindowManager(125): Window freeze timeout expired.
08-01 11:59:20.300: ERROR/InputDispatcher(125): channel '40f8bc80 com.android.launcher/com.android.launcher2.Launcher (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-01 11:59:20.300: ERROR/InputDispatcher(125): channel '40f8bc80 com.android.launcher/com.android.launcher2.Launcher (server)' ~ Channel is unrecoverably broken and will be disposed!
08-01 11:59:20.300: INFO/ActivityManager(125): Process com.android.launcher (pid 3723) has died.
08-01 11:59:20.300: INFO/WindowManager(125): WINDOW DIED Window{40f8bc80 com.android.launcher/com.android.launcher2.Launcher paused=false}
08-01 11:59:20.300: WARN/WindowManager(125): Failed looking up window
08-01 11:59:20.300: WARN/WindowManager(125): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@40acdc08 does not exist
08-01 11:59:20.300: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9423)
08-01 11:59:20.300: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9414)
08-01 11:59:20.300: WARN/WindowManager(125): at com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:8153)
08-01 11:59:20.300: WARN/WindowManager(125): at android.os.BinderProxy.sendDeathNotice(Binder.java:385)
08-01 11:59:20.300: WARN/WindowManager(125): at dalvik.system.NativeStart.run(Native Method)
08-01 11:59:20.300: INFO/WindowManager(125): WIN DEATH: null
08-01 11:59:21.460: ERROR/MediaPlayer(4435): stop called in state 1
08-01 11:59:21.460: ERROR/MediaPlayer(4435): error (-38, 0)
08-01 11:59:21.490: INFO/OMXCodec(85): [OMX.Nvidia.h264.decode] AVC profile = 66 (Baseline), level = 13
08-01 11:59:21.490: INFO/OMXCodec(85): [OMX.Nvidia.h264.decode] allocating 10 buffers of size 1566720 on input port
08-01 11:59:21.490: INFO/OMXCodec(85): [OMX.Nvidia.h264.decode] allocating 9 buffers from a native window of size 777600 on output port
08-01 11:59:21.520: INFO/WindowManager(125): WIN DEATH: Window{40bad270 RecentsPanel paused=false}
08-01 11:59:21.520: INFO/ActivityManager(125): Process com.android.systemui (pid 177) has died.
08-01 11:59:21.520: WARN/ActivityManager(125): Scheduling restart of crashed service com.android.systemui/.SystemUIService in 1250ms
08-01 11:59:21.520: ERROR/InputDispatcher(125): channel '40b511d8 NotificationPanel (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-01 11:59:21.520: ERROR/InputDispatcher(125): channel '40b511d8 NotificationPanel (server)' ~ Channel is unrecoverably broken and will be disposed!
08-01 11:59:21.520: INFO/WindowManager(125): WIN DEATH: Window{40b51d98 NotificationPeekWindow paused=false}
08-01 11:59:21.520: INFO/StatusBarManagerService(125): binder died for pkg=com.android.systemui
08-01 11:59:21.520: INFO/WindowManager(125): WIN DEATH: Window{40b58810 StatusBar paused=false}
08-01 11:59:21.530: INFO/ActivityManager(125): Start proc com.android.systemui for restart com.android.systemui: pid=4553 uid=1000 gids={2001, 3003, 3002, 3001}
08-01 11:59:21.530: INFO/WindowManager(125): WIN DEATH: Window{409fd688 InputMethodsPanel paused=false}
08-01 11:59:21.530: INFO/WindowManager(125): WINDOW DIED Window{40b511d8 NotificationPanel paused=false}
08-01 11:59:21.530: WARN/WindowManager(125): Failed looking up window
08-01 11:59:21.530: WARN/WindowManager(125): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@40b50fe8 does not exist
08-01 11:59:21.530: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9423)
08-01 11:59:21.530: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9414)
08-01 11:59:21.530: WARN/WindowManager(125): at com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:8153)
08-01 11:59:21.530: WARN/WindowManager(125): at android.os.BinderProxy.sendDeathNotice(Binder.java:385)
08-01 11:59:21.530: WARN/WindowManager(125): at dalvik.system.NativeStart.run(Native Method)
08-01 11:59:21.530: INFO/WindowManager(125): WIN DEATH: null
08-01 11:59:21.540: WARN/GraphicBufferAllocator(125): alloc(720, 720, 842094169, 00002100, ...) failed -12 (Out of memory)
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Allocated buffers:
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x1c1a08: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x225fd0: 3850.00 KiB | 800 ( 800) x 1232 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x22d198: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2a5250: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2ae858: 5280.00 KiB | 1920 (1920) x 1408 | 4 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3510f0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3b0958: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x40e238: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x41a3c0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x5bfe60: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Total allocated: 12251.38 KB
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Nvidia Gralloc
08-01 11:59:21.540: ERROR/SurfaceFlinger(125): Layer::requestBuffer(this=0x35dab0), index=5, w=720, h=720 failed (Out of memory)
08-01 11:59:21.540: WARN/GraphicBufferAllocator(125): alloc(800, 1232, 1, 00000300, ...) failed -12 (Out of memory)
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Allocated buffers:
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x1c1a08: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x225fd0: 3850.00 KiB | 800 ( 800) x 1232 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x22d198: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2a5250: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x2ae858: 5280.00 KiB | 1920 (1920) x 1408 | 4 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3510f0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x3b0958: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x40e238: 150.00 KiB | 800 ( 800) x 48 | 2 | 0x00000133
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x41a3c0: 506.25 KiB | 720 ( 720) x 720 | 32315659 | 0x00002100
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): 0x5bfe60: 398.19 KiB | 360 ( 368) x 277 | 1 | 0x00000300
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Total allocated: 12251.38 KB
08-01 11:59:21.540: DEBUG/GraphicBufferAllocator(125): Nvidia Gralloc
08-01 11:59:21.540: ERROR/SurfaceFlinger(125): Layer::requestBuffer(this=0x5b8568), index=1, w=800, h=1232 failed (Out of memory)
08-01 11:59:21.560: ERROR/InputDispatcher(125): channel '40f0e030 com.myapp/com.myApp.MyActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8
08-01 11:59:21.560: ERROR/InputDispatcher(125): channel '40f0e030 com.myapp/com.myApp.MyActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-01 11:59:21.560: INFO/WindowManager(125): WINDOW DIED Window{40f0e030 com.myapp/com.myApp.MyActivity paused=false}
08-01 11:59:21.560: WARN/WindowManager(125): Force-removing child win Window{40f21568 SurfaceView paused=false} from container Window{40f0e030 com.myapp/com.myApp.MyActivity paused=false}
08-01 11:59:21.570: WARN/AudioSystem(215): AudioFlinger server died!
08-01 11:59:21.570: WARN/AudioSystem(215): AudioPolicyService server died!
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.audio_flinger' died
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.player' died
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.camera' died
08-01 11:59:21.570: INFO/ServiceManager(80): service 'media.audio_policy' died
08-01 11:59:21.570: WARN/IMediaDeathNotifier(125): media server died
08-01 11:59:21.570: WARN/AudioSystem(125): AudioPolicyService server died!
08-01 11:59:21.570: INFO/ActivityManager(125): Process com.myapp (pid 4435) has died.
08-01 11:59:21.570: WARN/WindowManager(125): Failed looking up window
08-01 11:59:21.570: WARN/WindowManager(125): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@41041880 does not exist
08-01 11:59:21.570: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9423)
08-01 11:59:21.570: WARN/WindowManager(125): at com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:9414)
08-01 11:59:21.570: WARN/WindowManager(125): at com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:8153)
08-01 11:59:21.570: WARN/WindowManager(125): at android.os.BinderProxy.sendDeathNotice(Binder.java:385)
08-01 11:59:21.570: WARN/WindowManager(125): at dalvik.system.NativeStart.run(Native Method)
08-01 11:59:21.570: INFO/WindowManager(125): WIN DEATH: null
08-01 11:59:21.570: INFO/ActivityManager(125): Start proc com.android.launcher for activity com.android.launcher/com.android.launcher2.Launcher: pid=4559 uid=10025 gids={}
08-01 11:59:21.650: INFO/ActivityThread(4559): Pub com.android.launcher2.settings: com.android.launcher2.LauncherProvider
So the question is, how can i make sure this doesn't happen? And specifically:
- Do i need to take particular care of caches and such, how?
- Do i have to limit my amount of hardware accelerated views?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
硬件层在内存方面的成本非常高。您应该只在视图上暂时启用它们(例如,在动画的持续时间内)。要进入您所描述的状态,您的应用程序必须在 Xoom 平板电脑上使用超过 256+32 MB 的视频内存。另外,如果您使用 WebView,请小心,因为它本身会使用相当多的内存。
Hardware layers are very costly in terms of memory. You should only enable them temporarily on views (for the duration of an animation for instance.) To get in the state you are describing your app must use more than 256+32 MB of video memory on a Xoom tablet. Also, if you are using WebView, be careful as it uses quite a bit of memory itself.