为什么在android上发生ActivityManager ANR?

时间:2017-03-23 00:24:31

标签: android

我的应用经常发生logcat ActivityManager ANR消息和app死亡。

我的logcat

03-23 09:14:42.039 1439-1465/system_process E/ActivityManager: ANR in kr.co.iosystem.blackeyeonandroid (kr.co.iosystem.blackeyeonandroid/.BlackEyeActivity)
       PID: 4340
       Reason: Input dispatching timed out (Waiting to send key event because the focused window has not finished processing all of the input events that were previously delivered to it.  Outbound queue length: 0.  Wait queue length: 1.)
       Load: 2.46 / 0.85 / 0.42
       CPU usage from 31258ms to 0ms ago:
     9.4% 1142/mediaserver: 8.9% user + 0.4% kernel / faults: 1777 minor
     5.3% 3871/kworker/1:0: 0% user + 0.1% kernel + 5.1% iowait
     5.2% 1439/system_server: 3.3% user + 1.8% kernel / faults: 6114 minor
     4.4% 1135/surfaceflinger: 2.8% user + 1.5% kernel + 0% iowait / faults: 1451 minor
     3.1% 1551/com.android.systemui: 2.8% user + 0.3% kernel / faults: 3042 minor
     2.1% 4004/kworker/0:0: 0% user + 0% kernel + 2% iowait
     1.8% 1057/jbd2/sda1-8: 0% user + 0% kernel + 1.7% iowait
     1% 1968/android.process.media: 0.7% user + 0.2% kernel / faults: 2441 minor
     0.9% 1154/adbd: 0.1% user + 0.8% kernel / faults: 6067 minor
     0.4% 1139/debuggerd: 0.1% user + 0.3% kernel / faults: 2986 minor
     0.3% 3766/kworker/u4:1: 0% user + 0.3% kernel
     0.2% 3/ksoftirqd/0: 0% user + 0.2% kernel
     0.2% 1090/logd: 0% user + 0.2% kernel / faults: 22 minor
     0.2% 2271/com.android.settings: 0.2% user + 0% kernel / faults: 367 minor 1 major
     0.2% 6/kworker/u4:0: 0% user + 0.2% kernel
     0.1% 1572/wpa_supplicant: 0% user + 0.1% kernel
     0.1% 1793/com.android.phone: 0% user + 0% kernel / faults: 330 minor
     0.1% 7/rcu_preempt: 0% user + 0.1% kernel
     0.1% 1750/com.google.android.gms.persistent: 0.1% user + 0% kernel / faults: 1716 minor
     0% 1783/org.android_x86.analytics: 0% user + 0% kernel / faults: 114 minor
     0% 1048/kworker/0:1H: 0% user + 0% kernel
     0% 1168/mysqld: 0% user + 0% kernel / faults: 6 minor
     0% 14/ksoftirqd/1: 0% user + 0% kernel
     0% 1149/zygote: 0% user + 0% kernel / faults: 2472 minor
     0% 1532/sdcard: 0% user + 0% kernel
     0% 1738/com.google.android.inputmethod.korean: 0% user + 0% kernel / faults: 5 minor
     0% 2085/com.google.android.gms: 0% user + 0% kernel / faults: 281 minor
    +0% 4340/kr.co.iosystem.blackeyeonandroid: 0% user + 0% kernel
    +0% 4352/logcat: 0% user + 0% kernel
    +0% 4983/app_process: 0% user + 0% kernel
       64% TOTAL: 31% user + 30% kernel + 1.4% iowait + 0.9% softirq
       CPU usage from 1588ms to 2097ms later:
     138% 4340/kr.co.iosystem.blackeyeonandroid: 51% user + 87% kernel / faults: 544 minor
       99% 4656/ackeyeonandroid: 23% user + 75% kernel
       13% 4984/MediaCodec_loop: 7.9% user + 5.9% kernel
       11% 4987/le.h264.encoder: 9.9% user + 1.9% kernel
       11% 4989/pool-6-thread-1: 7.9% user + 3.9% kernel
       1.9% 4519/GLThread 248: 1.9% user + 0% kernel
     13% 1142/mediaserver: 13% user + 0% kernel
       7.8% 4540/CameraPreviewTh: 7.8% user + 0% kernel
       7.8% 4851/CameraPreviewTh: 7.8% user + 0% kernel
     1.9% 1439/system_server: 1.9% user + 0% kernel
       81% TOTAL: 34% user + 45% kernel + 1% iowait

我搜索了android开发者网站。

何时发生ANR? - 通过触摸屏输入的用户未在5秒内处理完毕 - 在10秒内未处理广播 - 在20秒内未处理服务

但它不属于他们。

为什么ANR我的应用程序?

0 个答案:

没有答案