As in the following example, besides the cpu usage value in each process, there's also a pair of "faults" values in "minor" and "major". What's the exact meaning?
ANR in com.rescuetime.android
PID: 11517
Reason: Broadcast of Intent { act=android.intent.action.SCREEN_ON flg=0x50000010 }
Load: 3.35 / 5.22 / 9.91
CPU usage from 0ms to 7475ms later with 99% awake:
97% 947/system_server: 80% user + 16% kernel / faults: 7489 minor 81 major
0.1% 269/debuggerd: 0% user + 0% kernel / faults: 4711 minor 16 major
7% 1493/com.android.phone: 3.3% user + 3.7% kernel / faults: 3615 minor 10 major
6.5% 1201/com.android.systemui: 3.3% user + 3.2% kernel / faults: 3074 minor 5 major
Yes the minor/major fault is just the minor/major page fault in Linux Kernel terminology. Explanation for them can be found on the Internet.
Android is reading such data from the proc file system. For a particular pid, the data is read from "/proc/" + pid + "/stats". One example of that is copied below:
/proc/24759 # cat stat
24759 (t_app_installer) S 2580 2580 0 0 -1 1077952832 13620 0 177 0 40 25 0 0 20 0 15 0 44123212 1066246144 12491 4294967295 2248540160 2248562159 3202042320 3202035120 2966304256 0 4612 1 1073775864 4294967295 0 0 17 6 0 0 0 0 0 2248567976 2248568832 2249576448 3202042577 3202042653 3202042653 3202043876 0
As of now, the 10th value is the minor fault. 13620 in this case. And the 12th is the major fault.
Related
I have been testing all of my apps using a physical device so far because when I first started programming, I could not get the emulator to work. But now, I decided that it would be extremely beneficial for my work to get the emulator to work. I am using a basic hello world app in this post to eliminate any possibility of it being a result of error in my code. If someone could supply a fix to my issues that would be very much appreciated!
Here is the error message which is repeatedly outputted to Logcat:
2018-11-18 20:49:34.238 1409-1436/system_process E/ActivityManager:
ANR in com.google.android.gms
PID: 5881
Reason: executing service com.google.android.gms/.stats.service.DropBoxEntryAddedService
Load: 0.0 / 0.0 / 0.0
CPU usage from 48963ms to 0ms ago (2018-11-18 20:48:43.912 to 2018-11-18 20:49:32.876):
23% 1409/system_server: 12% user + 10% kernel / faults: 174 minor
8.8% 2630/com.google.process.gapps: 5.5% user + 3.3% kernel / faults: 503 minor
7.6% 905/adbd: 0.9% user + 6.7% kernel / faults: 273 minor
3.3% 3/ksoftirqd/0: 0% user + 3.3% kernel
3.2% 8/rcu_preempt: 0% user + 3.2% kernel
2.7% 5202/com.google.android.gms.persistent: 2.3% user + 0.3% kernel / faults: 195 minor
2.4% 2588/android.process.acore: 2.1% user + 0.2% kernel / faults: 33 minor
1.4% 5550/logcat: 0.4% user + 1% kernel
1.4% 2655/kworker/u2:0: 0% user + 1.4% kernel
1.4% 4157/kworker/u2:3: 0% user + 1.4% kernel
1% 866/logd: 0.2% user + 0.8% kernel / faults: 1 minor
1% 3425/com.android.systemui: 0.7% user + 0.2% kernel / faults: 14 minor
0.5% 3171/com.android.phone: 0.3% user + 0.2% kernel / faults: 7 minor
0.4% 5735/kworker/0:1: 0% user + 0.4% kernel
0.3% 904/surfaceflinger: 0.2% user + 0.1% kernel
0.3% 906/zygote64: 0.1% user + 0.1% kernel / faults: 160 minor
0.2% 1973/wpa_supplicant: 0% user + 0.2% kernel
0.2% 903/servicemanager: 0.1% user + 0% kernel
0.1% 843/jbd2/vdc-8: 0% user + 0.1% kernel
0% 911/installd: 0% user + 0% kernel / faults: 7 minor
0% 923/rild: 0% user + 0% kernel
0% 720/kworker/0:1H: 0% user + 0% kernel
0% 1102/hostapd: 0% user + 0% kernel
0% 902/lmkd: 0% user + 0% kernel
0% 4726/com.google.android.youtube: 0% user + 0% kernel
0% 928/fingerprintd: 0% user + 0% kernel
+0% 5881/com.google.android.gms: 0% user + 0% kernel
+0% 5895/dex2oat: 0% user + 0% kernel
100% TOTAL: 63% user + 35% kernel + 0.8% softirq
CPU usage from 4359216ms to 4359216ms ago (1970-01-01 01:00:00.000 to 1970-01-01 01:00:00.000) with 0% awake:
0% TOTAL: 0% user + 0% kernel
Edit
Upon closing the emulator & opening it again. I am getting very similar messages, but for different things.
e.g
1970-01-01 01:25:07.476 2750-2768/? E/ActivityThread: Failed to find provider info for com.google.android.voicesearch
1970-01-01 01:26:25.738 1409-1438/? E/libprocessgroup: failed to kill 1 processes for processgroup 2326
1970-01-01 01:26:34.089 1409-1436/? E/ActivityManager: ANR in com.android.launcher3:wallpaper_chooser
PID: 2920
Reason: executing service com.android.launcher3/.dynamicui.ColorExtractionService
Load: 0.0 / 0.0 / 0.0
CPU usage from 24202ms to 0ms ago (1970-01-01 01:26:03.716 to 1970-01-01 01:26:27.918):
43% 2794/zygote64: 39% user + 4.6% kernel / faults: 1630 minor 19 major
21% 1409/system_server: 14% user + 7.1% kernel / faults: 776 minor
3.9% 2920/com.android.launcher3:wallpaper_chooser: 1.3% user + 2.6% kernel / faults: 3392 minor
2.1% 905/adbd: 0.2% user + 1.9% kernel / faults: 176 minor
1.6% 8/rcu_preempt: 0% user + 1.6% kernel
1.4% 906/zygote64: 0.2% user + 1.1% kernel / faults: 320 minor
1.2% 868/debuggerd64: 0.2% user + 0.9% kernel / faults: 30 minor
0.7% 2630/com.google.process.gapps: 0.4% user + 0.2% kernel / faults: 12 minor
0.7% 2588/android.process.acore: 0.3% user + 0.3% kernel / faults: 58 minor
0.6% 2701/com.google.android.setupwizard: 0.1% user + 0.4% kernel / faults: 301 minor 1 major
0.4% 866/logd: 0.2% user + 0.2% kernel / faults: 10 minor
0.3% 843/jbd2/vdc-8: 0% user + 0.3% kernel
0.3% 867/debuggerd: 0% user + 0.3% kernel / faults: 92 minor
0.3% 238/kworker/0:1: 0% user + 0.3% kernel
0.2% 720/kworker/0:1H: 0% user + 0.2% kernel
0.2% 3/ksoftirqd/0: 0% user + 0.2% kernel
0% 2060/logcat: 0% user + 0% kernel
0.2% 2684/com.android.systemui: 0% user + 0.2% kernel
0.1% 746/kworker/u2:2: 0% user + 0.1% kernel
0% 2525/com.google.android.googlequicksearchbox:interactor: 0% user + 0% kernel / faults: 83 minor 1 major
0% 1980/com.android.inputmethod.latin: 0% user + 0% kernel
0% 910/drmserver: 0% user + 0% kernel / faults: 7 minor
0% 913/media.codec: 0% user + 0% kernel
0% 915/mediadrmserver: 0% user + 0% kernel / faults: 7 minor
0% 919/mediaserver: 0% user + 0% kernel
0% 1102/hostapd: 0% user + 0% kernel
0% 1973/wpa_supplicant: 0% user + 0% kernel
0% 2444/com.android.settings: 0% user + 0% kernel / faults: 9 minor
+0% 2944/cmd: 0% user + 0% kernel
+0% 2955/com.google.android.deskclock: 0% user + 0% kernel
+0% 2970/com.android.phone: 0% user + 0% kernel
100% TOTAL: 64% user + 35% kernel + 0.2% softirq
CPU usage from 1587917ms to 1587917ms ago (1970-01-01 01:00:00.000 to 1970-01-01 01:00:00.000) with 0% awake:
0% TOTAL: 0% user + 0% kernel
2018-11-18 19:53:48.371 1409-1439/? E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
2018-11-18 19:53:48.389 1409-1439/? E/KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat (No such file or directory)
Thanks a lot in advance!
-Pi Net
I get this error for system_process(351) from logcat, when ever I start Emulator on my Ubuntu x64 14.04 LTS
05-30 03:23:23.789 351-351/system_process E/PowerManagerService-JNI﹕ Couldn't load power module (No such file or directory)
05-30 03:23:37.213 351-351/system_process E/ConsumerIrService﹕ Can't open consumer IR HW Module, error: -2
05-30 03:23:38.002 351-441/system_process E/EventHub﹕ could not get driver version for /dev/input/mouse0, Not a typewriter
05-30 03:23:38.078 351-441/system_process E/EventHub﹕ could not get driver version for /dev/input/mice, Not a typewriter
05-30 03:23:40.988 351-351/system_process E/WifiConfigStore﹕ associatedPartialScanPeriodMilli set to 20000
05-30 03:23:43.360 351-351/system_process E/Fingerprint-JNI﹕ Can't open fingerprint HW Module, error: -2
05-30 03:23:43.781 351-351/system_process E/SQLiteLog﹕ (283) recovered 16 frames from WAL file /data/system/locksettings.db-wal
05-30 03:23:43.910 351-351/system_process E/LockSettingsStorage﹕ Cannot read file java.io.FileNotFoundException: /data/system/password.key: open failed: ENOENT (No such file or directory)
05-30 03:23:43.912 351-351/system_process E/LockSettingsStorage﹕ Cannot read file java.io.FileNotFoundException: /data/system/gesture.key: open failed: ENOENT (No such file or directory)
05-30 03:23:48.754 351-446/system_process E/VoldConnector﹕ NDC Command {5 volume mount /storage/sdcard} took too long (2797ms)
05-30 03:23:54.719 351-351/system_process E/NetdConnector﹕ NDC Command {1 bandwidth enable} took too long (8830ms)
05-30 03:23:56.556 351-351/system_process E/NetdConnector﹕ NDC Command {2 firewall disable} took too long (1725ms)
05-30 03:23:57.850 351-351/system_process E/NetdConnector﹕ NDC Command {4 bandwidth setglobalalert 2097152} took too long (1127ms)
05-30 03:23:58.419 351-471/system_process E/BluetoothAdapter﹕ Bluetooth binder is null
05-30 03:23:58.422 351-471/system_process E/BluetoothAdapter﹕ Bluetooth binder is null
05-30 03:23:58.619 351-351/system_process E/InputMethodManagerService﹕ Ignoring setImeWindowStatus due to an invalid token. uid:1000 token:null
05-30 03:23:59.404 351-351/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:23:59.414 351-351/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:24:00.971 351-351/system_process E/LocationManagerService﹕ no geocoder provider found
05-30 03:24:00.972 351-351/system_process E/FlpHardwareProvider﹕ Error hw_get_module 'flp': -2
05-30 03:24:00.972 351-351/system_process E/LocationManagerService﹕ FLP HAL not supported
05-30 03:24:01.098 351-351/system_process E/LocationManagerService﹕ Unable to bind FLP Geofence proxy.
05-30 03:24:01.099 351-351/system_process E/ActivityRecognitionHardware﹕ Error hw_get_module: -2
05-30 03:24:01.100 351-351/system_process E/LocationManagerService﹕ Hardware Activity-Recognition not supported.
05-30 03:24:06.516 351-351/system_process E/BluetoothAdapter﹕ Bluetooth binder is null
05-30 03:24:06.970 351-351/system_process E/BluetoothAdapter﹕ Bluetooth binder is null
05-30 03:24:15.846 351-463/system_process E/ConnectivityService﹕ Failed to find Messenger in unregisterNetworkFactory
05-30 03:24:34.061 351-373/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:24:36.634 351-374/system_process E/ActivityManager﹕ ANR in com.android.systemui
PID: 512
Reason: Broadcast of Intent { act=android.intent.action.TIME_TICK flg=0x50000014 (has extras) }
Load: 8.32 / 2.56 / 0.9
CPU usage from 4973ms to -18546ms ago:
26% 351/system_server: 16% user + 9.8% kernel / faults: 8830 minor 2 major
14% 54/surfaceflinger: 7.9% user + 6.9% kernel / faults: 11 minor
11% 774/com.android.launcher: 9.4% user + 2.3% kernel / faults: 10923 minor 6 major
8.8% 751/zygote: 5.6% user + 3.2% kernel / faults: 6687 minor 8 major
7.7% 512/com.android.systemui: 5.4% user + 2.2% kernel / faults: 4516 minor 1 major
1.1% 62/debuggerd: 0.3% user + 0.8% kernel / faults: 2491 minor
2.9% 60/adbd: 0.5% user + 2.3% kernel / faults: 1314 minor
2.7% 100/bootanimation: 1.1% user + 1.6% kernel
1.9% 710/com.android.inputmethod.latin: 1.4% user + 0.4% kernel / faults: 1510 minor
1.2% 26/mtdblock1: 0% user + 1.2% kernel
1.2% 803/android.process.acore: 0.9% user + 0.2% kernel / faults: 601 minor
1.1% 49/logd: 0.4% user + 0.6% kernel / faults: 27 minor
0.6% 631/android.process.media: 0.4% user + 0.1% kernel / faults: 1064 minor 6 major
0.5% 52/servicemanager: 0.2% user + 0.2% kernel
0.3% 65/mediaserver: 0.2% user + 0.1% kernel / faults: 10 minor
0.3% 221/logcat: 0.1% user + 0.2% kernel
0.1% 63/rild: 0.1% user + 0% kernel / faults: 4 minor
0.1% 94/kworker/0:2: 0% user + 0.1% kernel
0% 25/mtdblock0: 0% user + 0% kernel
0% 41/jbd2/mtdblock1-: 0% user + 0% kernel
+0% 964/sh: 0% user + 0% kernel
100% TOTAL: 62% user + 36% kernel + 0.5% softirq
CPU usage from 16102ms to 17141ms later:
20% 774/com.android.launcher: 18% user + 1.6% kernel / faults: 1749 minor
13% 774/ndroid.launcher: 12% user + 1.1% kernel
4.4% 788/GCDaemon: 4.4% user + 0% kernel
1.1% 937/RenderThread: 0.5% user + 0.5% kernel
0.5% 787/HeapTrimmerDaem: 0.5% user + 0% kernel
16% 351/system_server: 14% user + 1.6% kernel / faults: 9 minor
4.1% 374/ActivityManager: 2.4% user + 1.6% kernel
3.3% 358/JDWP: 3.3% user + 0% kernel
3.3% 360/FinalizerDaemon: 3.3% user + 0% kernel
2.4% 537/Binder_4: 1.6% user + 0.8% kernel
1.6% 736/Binder_6: 0.8% user + 0.8% kernel
0.8% 373/android.bg: 0.8% user + 0% kernel
0.8% 625/Binder_5: 0.8% user + 0% kernel
0.8% 839/Binder_7: 0.8% user + 0% kernel
16% 54/surfaceflinger: 6.9% user + 9.5% kernel
3.4% 54/surfaceflinger: 1.7% user + 1.7% kernel
3.4% 92/VSyncThread: 0.8% user + 2.6% kernel
2.6% 85/Binder_1: 0.8% user + 1.7% kernel
1.7% 97/surfaceflinger: 0.8% user + 0.8% kernel
1.7% 479/Binder_4: 1.7% user + 0% kernel
0.8% 86/DispSync: 0.8% user + 0% kernel
0.8% 90/Binder_2: 0.8% user + 0% kernel
0.8% 96/EventThread: 0% user + 0.8% kernel
0.8% 117/Binder_3: 0% user + 0.8% kernel
4.5% 751/com.android.phone: 2.2% user + 2.2% kernel / faults: 21 minor
4.5% 751/m.android.phone: 2.2% user + 2.2% kernel
3.9% 512/com.android.systemui: 2.8% user + 1.1% kernel / faults: 635 minor
2.8% 512/ndroid.systemui: 2.8% user + 0% kernel
+0% 955/AsyncTask #1: 0% user + 0% kernel
+0% 960/RenderThread: 0% user + 0% kernel
5.2% 60/adbd: 0.8% user + 4.3% kernel / faults: 74 minor
2.6% 200/adbd: 0.8% user + 1.7% kernel
1.7% 60/adbd: 0% user + 1.7% kernel
2.7% 631/android.process.media: 1.6% user + 1.1% kernel / faults: 244 minor
2.7% 631/d.process.media: 1.6% user + 1.1% kernel
2.8% 49/logd: 2.8% user + 0% kernel
2.8% 226/logd.reader.per: 2.8% user + 0% kernel
2.6% 100/bootanimation: 0% user + 2.6% kernel
2.6% 112/BootAnimation: 0% user + 2.6% kernel
1.6% 803/android.process.acore: 1.6% user + 0% kernel / faults: 8 minor
1.1% 844/ContactsProvide: 1.1% user + 0% kernel
0.5% 858/Binder_3: 0.5% user + 0% kernel
1.1% 710/com.android.inputmethod.latin: 1.1% user + 0% kernel / faults: 35 minor
1.1% 846/erunigram.en_US: 1.1% user + 0% kernel
100% TOTAL: 79% user + 20% kernel
05-30 03:24:36.986 351-374/system_process E/libprocessgroup﹕ failed to kill 1 processes for processgroup 512
05-30 03:24:40.696 351-463/system_process E/ConnectivityService﹕ RemoteException caught trying to send a callback msg for NetworkRequest [ id=2, legacyType=-1, [] ]
05-30 03:24:40.896 351-365/system_process E/libprocessgroup﹕ failed to kill 1 processes for processgroup 512
05-30 03:24:48.669 351-351/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:24:48.782 351-351/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:24:49.229 351-351/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:24:49.253 351-351/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:25:01.752 351-351/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:25:01.754 351-351/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:25:01.986 351-463/system_process E/NetdConnector﹕ NDC Command {18 idletimer add eth0 5 0} took too long (942ms)
05-30 03:25:05.967 351-374/system_process E/libprocessgroup﹕ failed to kill 1 processes for processgroup 631
05-30 03:25:10.162 351-455/system_process E/NetdConnector﹕ NDC Command {20 bandwidth setiquota eth0 9223372036854775807} took too long (3399ms)
05-30 03:25:13.027 351-373/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:25:13.029 351-373/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:25:13.035 351-373/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:25:13.037 351-373/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:25:13.064 351-373/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:25:13.066 351-373/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
05-30 03:25:13.077 351-373/system_process E/GpsLocationProvider﹕ no AGPS interface in set_agps_server
05-30 03:25:13.131 351-373/system_process E/GpsLocationProvider﹕ no GPS configuration interface in configuraiton_update
And also from com.android.systemui
05-30 03:25:02.692 992-992/com.android.systemui E/BluetoothAdapter﹕ Bluetooth binder is null
05-30 03:25:03.740 992-992/com.android.systemui E/BluetoothAdapter﹕ Bluetooth binder is null
According to my research on this problem, I centre it to issues with the sensor manager regarding the bluetooth emulation.
I have tired the solutions of editing the config file or wiping the user data.
I have made game in cocos2dx for ios device. Now I want to port it for android but, the code which works fine for ios is crashing for android. The eclipse shows 3 types of logCat outputs which are as follows.
///////////////////////////////////////////////////////////////////////////////////////////////////////
1) 11-27 10:41:05.168: W/SharedBufferStack(4417): waitForCondition(LockCondition) timed out (identity=302, status=0). CPU may be pegged. trying again.
///////////////////////////////////////////////////////////////////////////////////////////////////////
2) 11-27 10:41:36.448: D/lights(248): set_light_backlight: brightness=255
11-27 10:41:41.518: I/InputDispatcher(248): Application is not responding: Window{2b452080 org.cocos2dx.Saburbia_android/org.cocos2dx.Saburbia_android.Saburbia_android paused=false}. 5000.4ms since event, 5000.4ms since wait started
11-27 10:41:41.518: I/WindowManager(248): Input event dispatching timed out sending to org.cocos2dx.Saburbia_android/org.cocos2dx.Saburbia_android.Saburbia_android
11-27 10:41:41.528: I/Process(248): Sending signal. PID: 4417 SIG: 3
11-27 10:41:41.528: I/dalvikvm(4417): threadid=4: reacting to signal 3
11-27 10:41:41.728: I/Process(248): Sending signal. PID: 248 SIG: 3
11-27 10:41:41.728: I/dalvikvm(248): threadid=4: reacting to signal 3
11-27 10:41:41.748: I/dalvikvm(248): Wrote stack traces to '/data/anr/traces.txt'
11-27 10:41:41.748: I/Process(248): Sending signal. PID: 355 SIG: 3
11-27 10:41:41.748: I/dalvikvm(355): threadid=4: reacting to signal 3
11-27 10:41:41.758: I/dalvikvm(355): Wrote stack traces to '/data/anr/traces.txt'
11-27 10:41:41.758: I/Process(248): Sending signal. PID: 320 SIG: 3
11-27 10:41:41.758: I/dalvikvm(320): threadid=4: reacting to signal 3
11-27 10:41:41.758: I/dalvikvm(320): Wrote stack traces to '/data/anr/traces.txt'
11-27 10:41:41.968: D/dalvikvm(248): GC_EXPLICIT freed 952K, 49% free 6943K/13447K, external 3286K/4888K, paused 78ms
11-27 10:41:42.518: E/ActivityManager(248): ANR in org.cocos2dx.Saburbia_android (org.cocos2dx.Saburbia_android/.Saburbia_android)
11-27 10:41:42.518: E/ActivityManager(248): Reason: keyDispatchingTimedOut
11-27 10:41:42.518: E/ActivityManager(248): Load: 7.93 / 7.92 / 7.79
11-27 10:41:42.518: E/ActivityManager(248): CPU usage from 27270ms to 0ms ago:
11-27 10:41:42.518: E/ActivityManager(248): 99% 4417/org.cocos2dx.Saburbia_android: 99% user + 0% kernel / faults: 2 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3877/com.google.android.apps.maps: 0% user + 0% kernel / faults: 418 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3957/com.svox.pico: 0% user + 0% kernel / faults: 678 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 248/system_server: 0% user + 0% kernel / faults: 8 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 1679/com.sonyericsson.customization: 0% user + 0% kernel / faults: 283 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3647/com.sonyericsson.devicemonitor: 0% user + 0% kernel / faults: 179 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 121/rild: 0% user + 0% kernel / faults: 1 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 320/com.android.systemui: 0% user + 0% kernel / faults: 3 minor
11-27 10:41:42.518: E/ActivityManager(248): 0% 3731/com.sonyericsson.android.datamonitor: 0% user + 0% kernel / faults: 25 minor
11-27 10:41:42.518: E/ActivityManager(248): 100% TOTAL: 100% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): CPU usage from 461ms to 976ms later:
11-27 10:41:42.518: E/ActivityManager(248): 98% 4417/org.cocos2dx.Saburbia_android: 98% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): 96% 4418/HeapWorker: 96% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): 3.8% 248/system_server: 1.9% user + 1.9% kernel
11-27 10:41:42.518: E/ActivityManager(248): 1.9% 291/InputDispatcher: 0% user + 1.9% kernel
11-27 10:41:42.518: E/ActivityManager(248): 1.9% 442/er$SensorThread: 1.9% user + 0% kernel
11-27 10:41:42.518: E/ActivityManager(248): 100% TOTAL: 98% user + 1.9% kernel
11-27 10:41:42.518: I/InputDispatcher(248): Dropping event because the pointer is not down.
////////////////////////////////////////////////////////////////////////////////////////////////
3) and third reason is unknows as it shows meny memory address in logCat.
////////////////////////////////////////////////////////////////////////////////////////////////
I am using libcurl for web calls and pThread for threading. This game also have Facebook Integration which is done using Facebook API for mobile (Hackbook).
After facebook login, the native code connects to the server using libcurl and makes about 30 http calls using pThread so that rendering thread should not be paused for getting the response from server. Still while this loading is going on the logcat shows any of these 3 logs and restarts loading from the start. There are http request present in game also which are executed using pThreads but in game also it shows any of this 3 log and crashes randomely.
The same code works fine for the ios build. I am not able to find why its not running properly for Android. Please suggest if any rules have to be followed for android porting.
I am using versions as follows.
Android NDK : r8b
Cocos2dx : 2.0.3
Eclipse : 3.6.2
Android version : 2.2
System : Ubuntu 10.0.4
Devices : SonyEricsson NeoV (android2.3.4), Samsung Galaxy SII (android4.0.3).
Thanks in advance..
Try to find memory issue in iPhone,because auto-release code might not working correctly.
Also use the NDK stack for more detail error.
Update:Another way to track ndk stack on remote use the https://www.crittercism.com
Thank you.
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.
I just start working on a project which I have to upgrade and upload an update in Android Market. For now I'm just testing the application to see and find any bugs so I can fix them (the app is not written by me). So while I was testing, the application crashed and I got really strange exception (for me), which I've never seen before.
Here it is:
02-28 18:29:27.008: E/ActivityManager(96): ANR in com.nimasystems.android.radio
02-28 18:29:27.008: E/ActivityManager(96): Reason: Executing service
com.nimasystems.android.radio/com.nimasystems.android.player.service.DRadioPlayerService
02-28 18:29:27.008: E/ActivityManager(96): Load: 1.78 / 1.52 / 2.5
02-28 18:29:27.008: E/ActivityManager(96): CPU usage from 6617ms to 37ms ago:
02-28 18:29:27.008: E/ActivityManager(96): s.android.radio: 67% = 62% user + 5% kernel / faults: 13040 minor
02-28 18:29:27.008: E/ActivityManager(96): system_server: 16% = 8% user + 8% kernel / faults: 361 minor
02-28 18:29:27.008: E/ActivityManager(96): akmd: 0% = 0% user + 0% kernel
02-28 18:29:27.008: E/ActivityManager(96): synaptics_wq: 0% = 0% user + 0% kernel
02-28 18:29:27.008: E/ActivityManager(96): adbd: 0% = 0% user + 0% kernel
02-28 18:29:27.008: E/ActivityManager(96): wpa_supplicant: 0% = 0% user + 0% kernel
02-28 18:29:27.008: E/ActivityManager(96): TOTAL: 85% = 70% user + 14% kernel
Any suggestions what can cause this kind of exception?
Thanks in advance!
ANR or application not responding usually happens when something in your code is preventing the UI thred to do its jobs. Any long term jobs or jobs that potentially can block the UI thread have to be execute in an async way. If you want help to debug you have to share a some code
the service com.nimasystems.android.player.service.DRadioPlayerService some method maybe used most time, the service run in the ui thread, so if you want avoid this, try create a new thread to run your wasted time method.