ANR 问题分析

http://www.jianshu.com/p/545e5e7bbf94

http://duanqz.github.io/2015-10-12-ANR-Analysis

Input dispatching timed out (Waiting because the focused window has not finished processing the input events that were previously delivered to it

搜索日志:”main” p ,ANR

// NOT RESPONDING: com.upotv.vod (pid 1884)

ANR in com.upotv.vod (com.upotv.vod/.activity.detail.DetailActivity)

PID: 1884

Reason: Input dispatching timed out (Waiting because the focused window has not finished processing the input events that were previously delivered to it.)

Load: 11.99 / 6.77 / 4.64

CPU usage from 3345ms to -22852ms ago:

69% 34/kconsole: 0% user + 69% kernel

28% 122/mediaserver: 7.9% user + 20% kernel / faults: 5773 minor 269 major

17% 1949/videodaemon: 3.4% user + 14% kernel / faults: 4439 minor 48 major

14% 99/rknand: 0% user + 14% kernel

10% 14714/com.shafa.market.remote: 8.1% user + 1.8% kernel / faults: 11181 minor 917 major

6.9% 425/system_server: 3.4% user + 3.4% kernel / faults: 8514 minor 856 major

4.6% 1884/com.upotv.vod: 2.2% user + 2.4% kernel / faults: 11154 minor 755 major

3.3% 55/kswapd0: 0% user + 3.3% kernel

2.9% 120/surfaceflinger: 1.3% user + 1.5% kernel / faults: 2329 minor 85 major

0.8% 118/debuggerd: 0.4% user + 0.3% kernel / faults: 3163 minor 100 major

1% 56/ksmd: 0% user + 1% kernel

0.8% 13189/kworker/u9:2: 0% user + 0.8% kernel

0.5% 14760/com.push.Youku_PushService: 0.1% user + 0.3% kernel / faults: 3450 minor 317 major

0.5% 14828/com.shafa.market:xg_service_v2: 0.1% user + 0.4% kernel / faults: 3134 minor 266 major

0.4% 6412/kworker/u9:1: 0% user + 0.4% kernel

0.1% 604/com.android.phone: 0% user + 0% kernel / faults: 981 minor 108 major

0.2% 50/cfinteractive: 0% user + 0.2% kernel

0.1% 490/com.android.keyguard: 0% user + 0% kernel / faults: 647 minor 42 major

0.1% 3/ksoftirqd/0: 0% user + 0.1% kernel

0.1% 8/rcu_preempt: 0% user + 0.1% kernel

0.1% 100/rknand_bg: 0% user + 0.1% kernel

0% 48/fb-vsync: 0% user + 0% kernel

0.1% 10838/kworker/2:2: 0% user + 0.1% kernel

0.1% 14700/com.shafa.market: 0% user + 0% kernel / faults: 1123 minor 33 major

0% 49/rk-fb: 0% user + 0% kernel

0% 121/zygote: 0% user + 0% kernel / faults: 329 minor 7 major

0% 2280/com.android.commands.monkey: 0% user + 0% kernel / faults: 1070 minor 43 major

0% 11118/kworker/1:2: 0% user + 0% kernel

0% 13499/kworker/u8:5: 0% user + 0% kernel

0% 14/ksoftirqd/1: 0% user + 0% kernel

0% 19/ksoftirqd/2: 0% user + 0% kernel

0% 24/ksoftirqd/3: 0% user + 0% kernel

0% 31/kworker/3:1: 0% user + 0% kernel

0% 52/irq/39-vpu_serv: 0% user + 0% kernel

0% 77/irq/76-rga: 0% user + 0% kernel

0% 94/kworker/0:1H: 0% user + 0% kernel

0% 975/adb: 0% user + 0% kernel / faults: 247 minor 2 major

0% 11209/kworker/0:1: 0% user + 0% kernel

0% 13364/kworker/1:0: 0% user + 0% kernel

+0% 14859/com.upotv.vod:report: 0% user + 0% kernel

93% TOTAL: 6.6% user + 33% kernel + 52% iowait + 1.1% softirq

CPU usage from 20971ms to 21539ms later:

96% 34/kconsole: 0% user + 96% kernel

26% 122/mediaserver: 7% user + 19% kernel / faults: 1 minor 3 major

19% 13985/DecoderAudio: 1.7% user + 17% kernel

3.5% 13987/Binder_1: 0% user + 3.5% kernel

1.7% 13986/DecoderVideo: 0% user + 1.7% kernel

15% 99/rknand: 0% user + 15% kernel

14% 425/system_server: 1.7% user + 12% kernel / faults: 53 minor 8 major

12% 439/ActivityManager: 3.5% user + 8.7% kernel

1.7% 438/WindowManager: 0% user + 1.7% kernel

1.7% 454/InputDispatcher: 0% user + 1.7% kernel

12% 1949/videodaemon: 10% user + 1.7% kernel / faults: 63 minor

7.1% 1952/videodaemon: 3.5% user + 3.5% kernel

5.2% 1884/com.upotv.vod: 1.7% user + 3.5% kernel / faults: 233 minor 31 major

3.5% 13948/Timer-157: 1.7% user + 1.7% kernel

1.7% 1884/com.upotv.vod: 0% user + 1.7% kernel

1.7% 55/kswapd0: 0% user + 1.7% kernel

1.7% 56/ksmd: 0% user + 1.7% kernel

1.7% 120/surfaceflinger: 1.7% user + 0% kernel / faults: 40 minor 4 major

1.7% 120/surfaceflinger: 1.7% user + 0% kernel

1.7% 132/DispSync: 0% user + 1.7% kernel

1.7% 6412/kworker/u9:1: 0% user + 1.7% kernel

1.7% 14714/com.shafa.market.remote: 0% user + 1.7% kernel / faults: 74 minor 12 major

0.6% 14828/com.shafa.market:xg_service_v2: 0% user + 0.6% kernel / faults: 305 minor 24 major

0.6% 14828/t:xg_service_v2: 0% user + 0.6% kernel

100% TOTAL: 2.5% user + 42% kernel + 54% iowait + 0.5% softirq

procrank:

PID      Vss      Rss      Pss      Uss  cmdline

1949    56440K  34776K  31827K  31800K  videodaemon

1884  984392K  30132K  24604K  23900K  com.upotv.vod

14714  544428K  25088K  18445K  17324K  com.shafa.market.remote

425  567428K  21160K  18310K  17768K  system_server

122  189372K  15060K  14687K  14608K  /system/bin/mediaserver

14760  525668K  11144K    4764K    4052K  com.push.Youku_PushService

14700  521300K  10468K    4430K    3772K  com.shafa.market

14828  515976K  10564K    3705K    2812K  com.shafa.market:xg_service_v2

14859  522264K  10544K    3365K    2456K  com.upotv.vod:report

2280  456296K    4164K    3081K    2928K  com.android.commands.monkey

490  514788K    8312K    2569K    2032K  com.android.keyguard

120    84196K    2548K    1862K    1688K  /system/bin/surfaceflinger

14901  508756K    9384K    1734K    708K  com.ktcp.video:push

604  526076K    6968K    1714K    1256K  com.android.phone

14911  508756K    9384K    1620K    692K  com.dangbeimarket:bdservice_v1

14923  508756K    9404K    1592K    660K  com.lycoo.lancy.bam

121  502540K    8388K    1307K    420K  zygote

14934    1760K    1232K    1070K    1048K  procrank

680  508664K    6036K    511K      12K  com.android.smspush

1      696K    352K    236K    160K  /init

13548    4236K    332K    221K    216K  vooleauth

1748    7676K    232K    208K    208K  /sbin/adbd

118    1088K    320K    172K    156K  /system/bin/debuggerd

117    9804K    224K    148K    144K  /system/bin/netd

975    7124K    244K    144K    140K  adb

113    1428K    128K    124K    124K  /sbin/healthd

98      588K    152K      76K      4K  /sbin/ueventd

114    1008K    116K      53K      52K  /system/bin/servicemanager

119    4628K    100K      34K      32K  /system/bin/rild

124    3348K      76K      10K      8K  /system/bin/keystore

115    5696K      84K      8K      4K  /system/bin/vold

116    6252K      76K      6K      4K  /system/bin/displayd

2019      932K      76K      6K      4K  /system/bin/sh

699    1024K      76K      6K      4K  /system/bin/dhcpcd

134      932K      72K      6K      4K  /system/bin/sh

123    1012K      72K      6K      4K  /system/bin/installd

126      968K      64K      5K      4K  /system/bin/bmd

——  ——  ——

142684K  131208K  TOTAL

RAM: 505188K total, 37088K free, 164K buffers, 13296K cached, 248K shmem, 23792K slab

// procrank status was 0

anr traces:

—– pid 1884 at 2017-05-24 10:12:52 —–

Cmd line: com.upotv.vod

JNI: CheckJNI is off; workarounds are off; pins=1; globals=318

DALVIK THREADS:

(mutexes: tll=0 tsl=0 tscl=0 ghl=0)

“main” prio=5 tid=1 SUSPENDED

| group=”main” sCount=1 dsCount=0 obj=0x41565400 self=0x4149d4b8

| sysTid=1884 nice=0 sched=0/0 cgrp=apps handle=1073901908

| state=S schedstat=( 171647864808 24070948587 181800 ) utm=14247 stm=2917 core=3

at android.view.ViewGroup.isLayoutModeOptical(ViewGroup.java:~2742)

at android.view.View.isLayoutModeOptical(View.java:14788)

at android.view.View.measure(View.java:16492)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)

at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)

at android.view.View.measure(View.java:16518)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)

at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)

at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)

at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)

at android.view.View.measure(View.java:16518)

at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)

at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)

at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2292)

at android.view.View.measure(View.java:16518)

at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1921)

at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1114)

at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1296)

at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1001)

at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5680)

at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)

at android.view.Choreographer.doCallbacks(Choreographer.java:574)

at android.view.Choreographer.doFrame(Choreographer.java:544)

at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)

at android.os.Handler.handleCallback(Handler.java:733)

at android.os.Handler.dispatchMessage(Handler.java:95)

at android.os.Looper.loop(Looper.java:136)

at android.app.ActivityThread.main(ActivityThread.java:5001)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:515)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:811)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:627)

at dalvik.system.NativeStart.main(Native Method)

“Timer-158” prio=5 tid=340 TIMED_WAIT

| group=”main” sCount=1 dsCount=0 obj=0x423b94f8 self=0x66fc8388

| sysTid=13950 nice=0 sched=0/0 cgrp=apps handle=1705469648

| state=S schedstat=( 13052473 370804 15 ) utm=1 stm=0 core=1

at java.lang.Object.wait(Native Method)

– waiting on <0x423b94f8> (a java.util.Timer$TimerImpl)

at java.lang.Object.wait(Object.java:401)

at java.util.Timer$TimerImpl.run(Timer.java:238)

    原文作者:sing_song
    原文地址: https://www.jianshu.com/p/2911e4761ab2
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞