I am getting an ANR sometimes when I run my Android service. I suspect it is happening because of a deadlock.
Is there an easy way to monitor deadlock in Android or Eclipse. Such as a utility to show which thread hold which lock etc.?
And is there a way to figure out a deadlock by looking at traces.txt file?
My ddms log looks like this at the time of crash
02-15 18:09:01.046: INFO/Process(90): Sending signal. PID: 450 SIG: 3
02-15 18:09:01.046: INFO/dalvikvm(450): threadid=3: reacting to signal 3
02-15 18:09:01.056: INFO/dalvikvm(450): Wrote stack traces to '/data/anr/traces.txt'
02-15 18:09:01.076: INFO/Process(90): Sending signal. PID: 10548 SIG: 9
02-15 18:09:01.076: ERROR/ActivityManager(90): ANR in com.abc.cm.core
02-15 18:09:01.076: ERROR/ActivityManager(90): Reason: Executing service com.abc.cm.core/.WorkOrderManager
02-15 18:09:01.076: ERROR/ActivityManager(90): Load: 1.46 / 1.16 / 1.05
02-15 18:09:01.076: ERROR/ActivityManager(90): CPU usage from 19462ms to 1067ms ago:
02-15 18:09:01.076: ERROR/ActivityManager(90): abc.cm.core: 13% = 12% user + 1% kernel / faults: 1360 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): mmcqd: 4% = 0% user + 4% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): system_server: 3% = 2% user + 1% kernel / faults: 473 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): zygote: 2% = 2% user + 0% kernel / faults: 90 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): adbd: 1% = 0% user + 1% kernel / faults: 1042 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): m.abc.unten: 0% = 0% user + 0% kernel / faults: 203 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): ndroid.launcher: 0% = 0% user + 0% kernel / faults: 802 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): droid.wallpaper: 0% = 0% user + 0% kernel / faults: 109 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): ndroid.settings: 0% = 0% user + 0% kernel / faults: 44 minor
02-15 18:09:01.076: ERROR/ActivityManager(90): dhd_dpc: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): events/0: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): logcat: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): +andisk.api.test: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): +iTestFwService1: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): +sh: 0% = 0% user + 0% kernel
02-15 18:09:01.076: ERROR/ActivityManager(90): TOTAL: 40% = 23% user + 16% kernel + 0% iowait + 0% softirq
02-15 18:09:01.096: INFO/ActivityManager(90): Process com.abc.cm.core (pid 10548) has died.
fixing deadlocks on any platform is hard. the only way I know on android is to add some logging (eg using Log.d) before and after each lock/unlock/otherExpensiveFunctions
Related
ANR in Android (Input dispatching timed out) (server) is not responding. Waited 5003ms for FocusEvent(hasFocus=true))
i'm not using network connections.
sometimes, occur this ANR. not every time.
i did search about this ANR. but i can not find same reasons..
i want know to what cases does this happen?
i don't have any idea about this ANR.
i can not guess anyone.... why happened?
why occured this ANR?
somebody help me, please...
E/ActivityManager: ANR in com.myapp.profindertest.debug (com.myapp.profindertest.debug/com.myapp.profindertest.HomeActivity)
PID: 29952
Reason: Input dispatching timed out (2339a79 com.myapp.profindertest.debug/com.myapp.profindertest.HomeActivity (server) is not responding. Waited 5003ms for FocusEvent(hasFocus=true))
Parent: com.myapp.profindertest.debug/com.myapp.profindertest.HomeActivity
Load: 5.32 / 5.66 / 5.68
----- Output from /proc/pressure/memory -----
some avg10=0.00 avg60=0.01 avg300=0.00 total=9675698
full avg10=0.00 avg60=0.00 avg300=0.00 total=1563915
----- End output from /proc/pressure/memory -----
CPU usage from 0ms to 7732ms later (2021-09-15 18:57:28.432 to 2021-09-15 18:57:36.165):
41% 29952/com.myapp.profindertest.debug: 33% user + 7.6% kernel / faults: 25810 minor
35% 2013/com.kt.tvcore.core: 21% user + 14% kernel / faults: 21391 minor
23% 693/system_server: 13% user + 10% kernel / faults: 10493 minor
16% 4044/com.kt.gigagenie.voicerecognition: 13% user + 3.2% kernel / faults: 3038 minor
6.9% 305/ktplayerd: 1.4% user + 5.5% kernel / faults: 338 minor
5.6% 217/logd: 1.9% user + 3.7% kernel / faults: 9 minor
5.3% 551/adbd: 1.8% user + 3.4% kernel / faults: 620 minor
4.9% 319/android.hardware.audio.service-droidlogic: 2.9% user + 1.9% kernel / faults: 156 minor
4.9% 850/com.android.systemui: 3.6% user + 1.2% kernel / faults: 4250 minor
4.2% 10912/com.google.android.gms.persistent: 3.3% user + 0.9% kernel / faults: 3391 minor
0.6% 538/media.swcodec: 0.3% user + 0.2% kernel / faults: 7843 minor
3.7% 1661/com.kt.tvcore.systemapp: 3.1% user + 0.6% kernel / faults: 1038 minor
3.6% 356/surfaceflinger: 1.6% user + 1.9% kernel / faults: 376 minor
3.4% 12267/com.google.android.gms: 2.4% user + 1% kernel / faults: 2640 minor
3.2% 322/android.hardware.cas#1.2-service: 0.9% user + 2.3% kernel
2.9% 348/genieaudio-service: 1.1% user + 1.8% kernel
0.4% 537/media.codec: 0.2% user + 0.1% kernel / faults: 5486 minor
0.3% 945/org.dtvkit.inputsource: 0.2% user + 0% kernel / faults: 1342 minor
1.9% 207/ueventd: 1.9% user + 0% kernel
1.9% 2462/libAltiBrowser.so: 1.2% user + 0.6% kernel / faults: 219 minor
1.8% 874/com.droidlogic: 1.2% user + 0.5% kernel / faults: 1129 minor
1.6% 234/vdec-core: 0% user + 1.6% kernel
0.2% 520/media.extractor: 0.1% user + 0% kernel / faults: 2895 minor
1.5% 333/android.hardware.graphics.composer#2.4-service.droidlogic: 0.6% user + 0.9% kernel
1.5% 1728/com.ktpns.pa: 1.2% user + 0.2% kernel / faults: 931 minor
1.5% 3961/logcat: 0.5% user + 1% kernel
0.2% 992/com.android.se: 0.1% user + 0% kernel / faults: 874 minor
1.1% 9/ksoftirqd/0: 0% user + 1.1% kernel
0.1% 1698/com.kt.tvcore.customizer: 0.1% user + 0% kernel / faults: 872 minor
1% 162/crtc_commit: 0% user + 1% kernel
0.9% 28197/kworker/u8:4-events_unbound: 0% user + 0.9% kernel / faults: 11 minor
0.7% 362/dtvkitserver: 0.2% user + 0.5% kernel
0.7% 13214/com.kt.androidtv: 0.5% user + 0.2% kernel / faults: 122 minor
0.7% 24924/kworker/u8:2-adb: 0% user + 0.7% kernel / faults: 24 minor
0.6% 366/tvserver: 0.1% user + 0.5% kernel
0.5% 1446/sugov:0: 0% user + 0.5% kernel
0.5% 29414/kworker/1:1-events_freezable: 0% user + 0.5% kernel
0.3% 828/com.android.bluetooth: 0% user + 0.3% kernel / faults: 128 minor
0.2% 10/rcu_preempt: 0% user + 0.2% kernel
0.2% 16/ksoftirqd/1: 0% user + 0.2% kernel
0.2% 136/aml-ditest-0: 0% user + 0.2% kernel
0% 302/tombstoned: 0% user + 0% kernel
0.2% 304/es_out_task: 0% user + 0.2% kernel
0.2% 310/statsd: 0.1% user + 0.1% kernel / faults: 136 minor
0.2% 311/netd: 0.1% user + 0.1% kernel / faults: 52 minor
0.2% 447/irq/23-fe330000: 0% user + 0.2% kernel
0.2% 1569/com.android.providers.tv: 0.2% user + 0% kernel / faults: 38 minor
0.2% 26658/kworker/u9:1-mali_jd: 0% user + 0.2% kernel
0% 28324/kworker/u9:2-kbase_pm_poweroff_wait: 0% user + 0% kernel
0% 1/init: 0% user + 0% kernel
0.1% 21/ksoftirqd/2: 0% user + 0.1% kernel
0.1% 26/ksoftirqd/3: 0% user + 0.1% kernel
E/ActivityManager: 0.1% 280/jbd2/dm-11-8: 0% user + 0.1% kernel
0.1% 303/ts_out_task: 0% user + 0.1% kernel
0.1% 332/android.hardware.graphics.allocator#4.0-service: 0% user + 0.1% kernel / faults: 1 minor
0.1% 353/audioserver: 0% user + 0.1% kernel / faults: 55 minor
0.1% 2402/transport: 0.1% user + 0% kernel
0.1% 3768/com.kt.tvcore.sode: 0.1% user + 0% kernel
0.1% 4350/irq/19-fe330000: 0% user + 0.1% kernel
0.1% 28607/kworker/0:3-events: 0% user + 0.1% kernel
+0% 30008/kworker/1:2H: 0% user + 0% kernel
+0% 30070/logcat: 0% user + 0% kernel
+0% 30077/logcat: 0% user + 0% kernel
62% TOTAL: 35% user + 20% kernel + 0.1% iowait + 2.4% irq + 3.9% softirq
CPU usage from 36ms to 520ms later (2021-09-15 18:57:28.469 to 2021-09-15 18:57:28.953):
53% 693/system_server: 20% user + 33% kernel / faults: 450 minor
45% 29999/AnrConsumer: 15% user + 30% kernel
2.5% 1395/IpClient.eth0: 2.5% user + 0% kernel
55% 2013/com.kt.tvcore.core: 32% user + 23% kernel / faults: 37 minor
23% 4802/Binder:2013_9: 14% user + 8.7% kernel
20% 5400/Binder:2013_D: 11% user + 8.7% kernel
2.9% 2378/.kt.tvcore.core: 2.9% user + 0% kernel
2.9% 4537/Thread-114: 2.9% user + 0% kernel
2.9% 5403/Binder:2013_10: 2.9% user + 0% kernel
42% 29952/com.myapp.profindertest.debug: 23% user + 19% kernel / faults: 49 minor
42% 29952/v.otshome.debug: 23% user + 19% kernel
19% 10912/com.google.android.gms.persistent: 16% user + 3.2% kernel / faults: 1052 minor
16% 10927/HeapTaskDaemon: 12% user + 3.2% kernel
15% 4044/com.kt.gigagenie.voicerecognition: 12% user + 3.1% kernel / faults: 53 minor
12% 4349/Thread-39: 12% user + 0% kernel
16% 12267/com.google.android.gms: 13% user + 3.3% kernel / faults: 851 minor
19% 12281/HeapTaskDaemon: 16% user + 3.3% kernel
6.9% 319/android.hardware.audio.service-droidlogic: 4.6% user + 2.3% kernel / faults: 4 minor
2.3% 29868/audio_output_pa: 0% user + 2.3% kernel
7.6% 551/adbd: 2.5% user + 5% kernel
5% 551/adbd: 2.5% user + 2.5% kernel
2.5% 605/UsbFfs-worker: 0% user + 2.5% kernel
4.4% 217/logd: 0% user + 4.4% kernel
2.2% 226/logd.writer: 2.2% user + 0% kernel
2.2% 3966/logd.reader.per: 0% user + 2.2% kernel
4.5% 305/ktplayerd: 0% user + 4.5% kernel / faults: 20 minor
2.2% 16407/HwBinder:305_3: 0% user + 2.2% kernel
2% 16/ksoftirqd/1: 0% user + 2% kernel
2% 21/ksoftirqd/2: 0% user + 2% kernel
2.2% 234/vdec-core: 0% user + 2.2% kernel
2.3% 322/android.hardware.cas#1.2-service: 0% user + 2.3% kernel
2.3% 3246/HwBinder:322_1: 0% user + 2.3% kernel
2.4% 348/genieaudio-service: 0% user + 2.4% kernel
2.4% 348/genieaudio-serv: 0% user + 2.4% kernel
2.4% 4352/genieaudio-serv: 0% user + 2.4% kernel
2.4% 362/dtvkitserver: 0% user + 2.4% kernel
2.4% 476/dmx_data_thread: 0% user + 2.4% kernel
2.4% 366/tvserver: 2.4% user + 0% kernel
2.7% 1446/sugov:0: 0% user + 2.7% kernel
3.1% 3961/logcat: 3.1% user + 0% kernel
3.5% 24924/kworker/u8:2-adb: 0% user + 3.5% kernel
62% TOTAL: 30% user + 26% kernel + 2.1% irq + 4.3% softirq
Recently, I've got raspberry pi 3 and I'm trying to run android things doorbell project. I build it in Android studio 3.0 and i did everything that explained in android things doorbell project. but when i build the app to raspberry pi, it doesn't work. When I try debugging, it terminates after few time passes(i didn't touch everything).
This is the system process debugging log. what do i have to do?
08-16 08:03:13.434 412-426/system_process W/ActivityManager: Launch timeout has expired, giving up wake lock!
08-16 08:03:28.361 412-426/system_process W/ActivityManager: Timeout executing service: ServiceRecord{c4f101b u0 com.example.androidthings.doorbell/com.google.android.gms.measurement.AppMeasurementService}
--------- beginning of main
08-16 08:03:28.397 412-426/system_process I/Process: Sending signal. PID: 6135 SIG: 3
08-16 08:03:28.407 412-426/system_process I/Process: Sending signal. PID: 412 SIG: 3
08-16 08:03:28.407 412-417/system_process I/art: Thread[2,tid=417,WaitingInMainSignalCatcherLoop,Thread*=0xa9b0d000,peer=0x12c010d0,"Signal Catcher"]: reacting to signal 3
08-16 08:03:29.011 412-417/system_process I/art: Wrote stack traces to '/data/anr/traces.txt'
08-16 08:03:29.011 412-426/system_process I/Process: Sending signal. PID: 537 SIG: 3
08-16 08:03:29.903 412-426/system_process W/ProcessCpuTracker: Skipping unknown process pid 6351
08-16 08:03:30.473 412-426/system_process E/ActivityManager: ANR in com.example.androidthings.doorbell
PID: 6135
Reason: executing service com.example.androidthings.doorbell/com.google.android.gms.measurement.AppMeasurementService
Load: 0.63 / 0.31 / 0.32
CPU usage from 557691ms to 0ms ago (2017-08-16 07:54:10.671 to 2017-08-16 08:03:28.362):
3.4% 412/system_server: 2.5% user + 0.9% kernel / faults: 2730 minor
2.4% 152/adbd: 0.2% user + 2.1% kernel / faults: 44173 minor
1.1% 1213/perfd: 0.6% user + 0.4% kernel / faults: 186 minor
0.5% 6014/kworker/u8:1: 0% user + 0.5% kernel
0.5% 101/irq/92-mmc1: 0% user + 0.5% kernel
0.4% 6035/kworker/u8:2: 0% user + 0.4% kernel
0.3% 6024/kworker/u8:0: 0% user + 0.3% kernel
0.3% 652/com.google.android.gms.persistent: 0.3% user + 0% kernel / faults: 1669 minor
0.3% 150/surfaceflinger: 0.2% user + 0% kernel / faults: 1514 minor
0% 107/brcmf_wdog/mmc1: 0% user + 0% kernel
0% 520/wpa_supplicant: 0% user + 0% kernel
0% 7/rcu_preempt: 0% user + 0% kernel
0% 840/com.google.android.gms: 0% user + 0% kernel / faults: 88 minor
0% 3/ksoftirqd/0: 0% user + 0% kernel
0% 20/ksoftirqd/3: 0% user + 0% kernel
0% 8/rcu_sched: 0% user + 0% kernel
0% 127/logd: 0% user + 0% kernel / faults: 14 minor
0% 169/metrics_collector: 0% user + 0% kernel / faults: 19 minor
0% 620/com.android.iotlauncher: 0% user + 0% kernel / faults: 20 minor
0% 104/mmcqd/0: 0% user + 0% kernel
0% 149/servicemanager: 0% user + 0% kernel
0% 170/metricsd: 0% user + 0% kernel
0% 756/com.google.process.gapps: 0% user + 0% kernel / faults: 19 minor
0% 16/ksoftirqd/2: 0% user + 0% kernel
0% 148/lmkd: 0% user + 0% kernel
0% 5353/kworker/0:0: 0% user + 0% kernel
0% 12/ksoftirqd/1: 0% user + 0% kernel
0% 66/kworker/2:1: 0% user + 0% kernel
0% 121/jbd2/mmcblk0p15: 0% user + 0% kernel
0% 153/zygote: 0% user + 0% kernel / faults: 141 minor
0% 10/migration/0: 0% user + 0% kernel
0% 19/migration/3: 0% user + 0% kernel
0% 163/netd: 0% user + 0% kernel / faults: 40 minor
0% 166/sh: 0% user + 0% kernel / faults: 102 minor
0% 172/update_engine: 0% user + 0% kernel
0% 5981/kworker/1:2: 0% user + 0% kernel
+0% 6046/kworker/2:0: 0% user + 0% kernel
+0% 6048/kworker/3:1: 0% user + 0% kernel
+0% 6135/com.example.androidthings.doorbell: 0% user + 0% kernel
+0% 6219/logcat: 0% user + 0% kernel
+0% 6337/dumpsys: 0% user + 0% kernel
3.2% TOTAL: 1.6% user + 1.3% kernel + 0% iowait + 0.2% softirq
CPU usage from 1542ms to 2074ms later (2017-08-16 08:03:29.904 to 2017-08-16 08:03:30.436):
67% 412/system_server: 46% user + 20% kernel / faults: 3 minor
31% 680/Binder:412_5: 26% user + 5.6% kernel
28% 628/Binder:412_4: 18% user + 9.3% kernel
5.6% 426/ActivityManager: 0% user + 5.6% kernel
1.8% 716/Binder:412_6: 0% user + 1.8% kernel
5.1% 1213/perfd: 3.4% user + 1.7% kernel / faults: 6 minor
1.7% 1223/perfd: 1.7% user + 0% kernel
1.7% 1224/perfd: 1.7% user + 0% kernel
1.7% 6149/Studio:PollMem: 0% user + 1.7% kernel
3.7% 152/adbd: 1.8% user + 1.8% kernel / faults: 59 minor
1.8% 152/adbd: 0% user + 1.8% kernel
1.8% 1146/->host: 1.8% user + 0% kernel
1.8% 1147/<-host: 0% user + 1.8% kernel
1.7% 6014/kworker/u8:1: 0% user + 1.7% kernel
+0% 6358/dumpsys: 0% user + 0% kernel
26% TOTAL: 17% user + 9.1% kernel
08-16 08:03:30.476 412-427/system_process W/ActivityManager: Force finishing activity com.example.androidthings.doorbell/.DoorbellActivity
08-16 08:03:30.483 412-427/system_process I/ActivityManager: Killing 6135:com.example.androidthings.doorbell/u0a28 (adj 0): user request after error
08-16 08:03:30.564 412-5697/system_process D/ActivityManager: cleanUpApplicationRecord -- 6135
08-16 08:03:30.569 412-433/system_process I/WindowManager: Destroying surface Surface(name=Starting com.example.androidthings.doorbell) called by com.android.server.wm.WindowStateAnimator.destroySurface:2014 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:881 com.android.server.wm.WindowState.removeLocked:1449 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2478 com.android.server.wm.WindowManagerService.removeWindowLocked:2436 com.android.server.wm.WindowManagerService.removeWindowLocked:2305 com.android.server.wm.WindowManagerService.removeWindow:2300 com.android.server.wm.Session.remove:193
08-16 08:03:30.614 412-424/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#79a2cdf attribute=null, token = android.os.BinderProxy#161884c
08-16 08:03:32.129 412-422/system_process I/art: Background partial concurrent mark sweep GC freed 26801(2MB) AllocSpace objects, 14(880KB) LOS objects, 33% free, 6MB/10MB, paused 2.427ms total 120.639ms
08-16 08:03:32.913 412-501/system_process I/ActivityManager: Force stopping com.example.androidthings.doorbell appid=10028 user=0: from pid 6365
08-16 08:03:34.067 412-479/system_process E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
I have noticed in my adobe air app that I get intermitent crashes while trying to close my Netconnection. The app stops responding and eventually if you keep trying to do something it crashes. It is happening around 7 out of 10 times which is weird!
Has anyone encountered this or knows whats going on?
Here is a link to the full ANR Trace: http://pastebin.com/ut0eZRrU
Thanks, any help would be appreciated. This bug is preventing me from releasing my app!
I have seen a few discussions where people are saying they are experiencing similar issues however, they also say that it has been sorted in air 3.3. I havent seen any improvement....
Here is a summary of what im getting in logcat:
D/dalvikvm( 2019): GC_CONCURRENT freed 1943K, 21% free 24500K/30855K, paused 2ms+21ms
D/dalvikvm( 2019): GC_EXPLICIT freed 769K, 20% free 24737K/30855K, paused 2ms+20ms
E/ActivityManager( 2019): ANR in air.com.test.mobile.rbttest.debug (air.com.test.mobile.rbttest.debug/.AppEntry)
E/ActivityManager( 2019): Reason: keyDispatchingTimedOut
E/ActivityManager( 2019): Load: 0.59 / 0.72 / 0.59
E/ActivityManager( 2019): CPU usage from 18567ms to 3234ms ago:
E/ActivityManager( 2019): 80% 9424/air.com.test.mobile.rbttest.debug: 71% user + 8.7% kernel / faults: 1406 minor
**could it be something to do with the line above? Is this line saying that my cpu has spiked up to 80%? Its weird if it is, because it works fine if I dont close the net connection!!**
E/ActivityManager( 2019): 2% 2019/system_server: 1.1% user + 0.8% kernel / faults: 39 minor
E/ActivityManager( 2019): 1.8% 2120/com.android.systemui: 1.5% user + 0.2% kernel / faults: 5 minor
E/ActivityManager( 2019): 1.5% 1885/mediaserver: 1.2% user + 0.3% kernel / faults: 4 minor
E/ActivityManager( 2019): 0.7% 1882/surfaceflinger: 0.3% user + 0.3% kernel
E/ActivityManager( 2019): 0.3% 9564/kworker/0:2: 0% user + 0.3% kernel
E/ActivityManager( 2019): 0.2% 2206/dhd_dpc: 0% user + 0.2% kernel
E/ActivityManager( 2019): 0.1% 1890/adbd: 0% user + 0.1% kernel
E/ActivityManager( 2019): 0.1% 8196/com.eolwral.osmonitor: 0% user + 0.1% kernel / faults: 20 minor
E/ActivityManager( 2019): 0.1% 8697/kworker/u:0: 0% user + 0.1% kernel
E/ActivityManager( 2019): 0.1% 965/irq/356-mxt224_: 0% user + 0.1% kernel
E/ActivityManager( 2019): 0.1% 7358/kworker/0:3: 0% user + 0.1% kernel
E/ActivityManager( 2019): 0% 3/ksoftirqd/0: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 1055/mmcqd/0: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 1830/jbd2/mmcblk0p10: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 1881/rild: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 2202/dhd_watchdog: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 2781/kworker/u:23: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 8708/kworker/u:1: 0% user + 0% kernel
E/ActivityManager( 2019): 0% 8756/com.android.settings: 0% user + 0% kernel / faults: 31 minor
E/ActivityManager( 2019): 0% 8860/com.google.android.gallery3d: 0% user + 0% kernel / faults: 8 minor
E/ActivityManager( 2019): 0% 27078/com.antivirus: 0% user + 0% kernel
E/ActivityManager( 2019): 49% TOTAL: 43% user + 6.4% kernel + 0.2% iowait + 0% softirq
E/ActivityManager( 2019): CPU usage from 707ms to 1226ms later:
E/ActivityManager( 2019): 10% 2019/system_server: 1.8% user + 9% kernel / faults: 3 minor
E/ActivityManager( 2019): 9% 2077/InputDispatcher: 0% user + 9% kernel
E/ActivityManager( 2019): 4.9% 2120/com.android.systemui: 3.9% user + 0.9% kernel / faults: 1 minor
E/ActivityManager( 2019): 3.9% 2120/ndroid.systemui: 3.9% user + 0% kernel
E/ActivityManager( 2019): 6.8% 9424/air.com.test.mobile.rbttest.debug: 0% user + 6.8% kernel
E/ActivityManager( 2019): 6.8% 9464/e.rbttest.debug: 1.7% user + 5.1% kernel
E/ActivityManager( 2019): 1.2% 7358/kworker/0:3: 0% user + 1.2% kernel
E/ActivityManager( 2019): 7.7% TOTAL: 1.9% user + 5.8% kernel
W/ActivityManager( 2019): Force finishing activity air.com.test.mobile.rbttest.debug/.AppEntry
I/ActivityManager( 2019): Killing ProcessRecord{416f3410 9424:air.com.test.mobile.rbttest.debug/10075}: user's request
I/ActivityManager( 2019): Process air.com.test.mobile.rbttest.debug (pid 9424) has died.
I/WindowManager( 2019): WIN DEATH: Window{420baca0 SurfaceView paused=false}
I/WindowManager( 2019): WIN DEATH: Window{41f93898 air.com.test.mobile.rbttest.debug/air.com.test.mobile.rbttest.debug.A ppEntry paused=true}
UPDATE:
I have found that if the NetConnection is either closed via the fms server of via the publisher then it causes the android app to crash!
The release of adobe air 3.4 beta seems to have fixed this issue.
I'm developping a simple widget which update by downloading a big image file.
To do so I'm just launching a service which retrieve the image. I launch it from the onUpdate method of AppWidgetProvider.
Like that :
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds)
{
Intent intent = new Intent(context, UpdateService.class);
context.startService(intent);
}
In wifi everything is working well.
But in 3G network is slow, the downloading take too much time. As a result my service is killed by android system.
Here the trace:
03-04 15:19:02.698: INFO/ActivityManager(166): Start proc com.testpic for broadcast
com.testpic/com.testpic.TestPicActivity: pid=1994 uid=10087 gids={1015, 3003}
03-04 15:19:22.889: WARN/ActivityManager(166): Timeout executing service:
ServiceRecord{41851230 com.testpic/com.testpic.service.UpdateService}
03-04 15:19:22.944: INFO/dalvikvm(166): Jit: resizing JitTable from 8192 to 16384
03-04 15:19:22.967: INFO/Process(166): Sending signal. PID: 1994 SIG: 3
03-04 15:19:22.967: INFO/dalvikvm(1994): threadid=3: reacting to signal 3
03-04 15:19:22.994: INFO/dalvikvm(1994): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:22.994: INFO/Process(166): Sending signal. PID: 166 SIG: 3
03-04 15:19:22.994: INFO/dalvikvm(166): threadid=3: reacting to signal 3
03-04 15:19:23.053: INFO/dalvikvm(166): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.053: INFO/Process(166): Sending signal. PID: 232 SIG: 3
03-04 15:19:23.053: INFO/dalvikvm(232): threadid=3: reacting to signal 3
03-04 15:19:23.061: INFO/dalvikvm(232): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.061: INFO/Process(166): Sending signal. PID: 342 SIG: 3
03-04 15:19:23.061: INFO/dalvikvm(342): threadid=3: reacting to signal 3
03-04 15:19:23.084: INFO/dalvikvm(342): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.084: INFO/Process(166): Sending signal. PID: 359 SIG: 3
03-04 15:19:23.084: INFO/dalvikvm(359): threadid=3: reacting to signal 3
03-04 15:19:23.096: INFO/dalvikvm(359): Wrote stack traces to '/data/anr/traces.txt'
03-04 15:19:23.272: DEBUG/dalvikvm(166): GC_CONCURRENT freed 914K, 16% free
13371K/15879K, paused 3ms+5ms
03-04 15:19:23.467: DEBUG/dalvikvm(166): GC_EXPLICIT freed 459K, 16% free 13475K/15879K,
paused 3ms+5ms
03-04 15:19:24.065: ERROR/ActivityManager(166): ANR in com.testpic
Reason: Executing service com.testpic/com.testpic.service.UpdateService
Load: 1.58 / 1.52 / 0.84
CPU usage from 12327ms to 0ms ago with 99% awake:
16% 166/system_server: 7.3% user + 9.4% kernel / faults: 8 minor
9.1% 1994/com.testpic: 7.1% user + 2% kernel / faults: 249 minor
0.7% 374/com.android.launcher: 0.6% user + 0% kernel / faults: 15 minor
0.6% 342/com.android.phone: 0.4% user + 0.2% kernel / faults: 15 minor
0.4% 5/kworker/u:0: 0% user + 0.4% kernel
0.4% 1343/kworker/0:1: 0% user + 0.4% kernel
0.4% 66/yaffs-bg-1: 0% user + 0.4% kernel
0.4% 77/rild: 0% user + 0.3% kernel
0.2% 897/de.devmil.minimaltext: 0.2% user + 0% kernel / faults: 63 minor
0.1% 293/com.google.process.gapps: 0% user + 0% kernel / faults: 4 minor
0% 159/logcat: 0% user + 0% kernel
0% 160/flush-179:0: 0% user + 0% kernel
0% 232/com.android.systemui: 0% user + 0% kernel / faults: 1 minor
0% 835/com.google.android.apps.maps:NetworkLocationService: 0% user + 0% kernel /
faults: 15 minor
25% TOTAL: 14% user + 11% kernel + 0.2% softirq
CPU usage from 577ms to 1090ms later with 99% awake:
22% 166/system_server: 8.7% user + 14% kernel
10% 182/ActivityManager: 3.5% user + 7% kernel
7% 179/system_server: 0% user + 7% kernel
3.5% 199/er$SensorThread: 0% user + 3.5% kernel
1.7% 181/er.ServerThread: 1.7% user + 0% kernel
4.5% 1994/com.testpic: 4.5% user + 0% kernel / faults: 4 minor
4.5% 1994/com.testpic: 4.5% user + 0% kernel
19% TOTAL: 7.6% user + 11% kernel
03-04 15:19:24.065: WARN/ActivityManager(166): Killing ProcessRecord{416316c0
1994:com.testpic/10087}: background ANR
03-04 15:19:24.073: INFO/ActivityManager(166): Process com.testpic (pid 1994) has died.
03-04 15:19:24.073: WARN/ActivityManager(166): Scheduling restart of crashed service
com.testpic/com.testpic.service.UpdateService in 42380ms
So my questions are :
- How can I do to avoid this ANR ?
- Is it correct to use a service in this kind of situation ?
- If not what should I use to perform that kind of treatment ?
Thank you in advance for your help :)
A regular Service still runs on the UI thread unless you tell it to spawn another one. Consider using an IntentService instead which handles that for you.
In my android application i am implementing map functionality. it has a tab bar when i jump one activity to another activity through tab its working perfectly. but when i come on map activity and try to move from it through "Back key of device" the entire application freezes and after a couple of seconds I get the dreaded force close dialog appearing and i got error.
11-11 10:53:26.083: ERROR/ActivityManager(85): ANR in com.project.activity
(com.project.activity/.MapActivity)
11-11 10:53:26.083: ERROR/ActivityManager(85): Reason: keyDispatchingTimedOut
11-11 10:53:26.083: ERROR/ActivityManager(85): Load: 2.64 / 1.75 / 1.64
11-11 10:53:26.083: ERROR/ActivityManager(85): CPU usage from 8749ms to 209ms ago:
11-11 10:53:26.083: ERROR/ActivityManager(85): dianic.activity: 18% = 16% user + 1% kernel / faults: 1938 minor
11-11 10:53:26.083: ERROR/ActivityManager(85): mediaserver: 14% = 14% user + 0% kernel
11-11 10:53:26.083: ERROR/ActivityManager(85): system_server: 4% = 2% user + 1% kernel / faults: 167 minor
11-11 10:53:26.083: ERROR/ActivityManager(85): dhd_dpc: 1% = 0% user + 1% kernel
11-11 10:53:26.083: ERROR/ActivityManager(85): android.vending: 0% = 0% user + 0% kernel / faults: 57 minor
11-11 10:53:26.083: ERROR/ActivityManager(85): synaptics_wq: 0% = 0% user + 0% kernel
11-11 10:53:26.083: ERROR/ActivityManager(85): e.process.gapps: 0% = 0% user + 0% kernel / faults: 3 minor
11-11 10:53:26.083: ERROR/ActivityManager(85): wpa_supplicant: 0% = 0% user + 0% kernel
11-11 10:53:26.083: ERROR/ActivityManager(85): logcat: 0% = 0% user + 0% kernel
11-11 10:53:26.083: ERROR/ActivityManager(85): TOTAL: 41% = 36% user + 5% kernel + 0% softirq
please guide me why this is occurring.. thanks in advance
This type of problem occur when code get window leak type of problem or when we try to perform many operation on same activity...