- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我遇到了一些应用程序卡住问题。看起来它与 hardwarerenderer 以及我正在使用的线程数量有关。我希望有人能查看日志并告诉我是否有任何明显的问题。谢谢。
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x401f6600 self=0x125f8
| sysTid=15811 nice=0 sched=0/0 cgrp=default handle=-1345129368
| schedstat=( 0 0 0 ) utm=2495 stm=1172 core=0
at com.google.android.gles_jni.EGLImpl.eglSwapBuffers(Native Method)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:648)
at android.view.ViewRoot.draw(ViewRoot.java:1594)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1410)
at android.view.ViewRoot.handleMessage(ViewRoot.java:2040)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
"Thread-811" prio=5 tid=31 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x412479c0 self=0x45e478
| sysTid=17073 nice=0 sched=0/0 cgrp=default handle=2020736
| schedstat=( 0 0 0 ) utm=4 stm=0 core=1
"Thread-810" prio=5 tid=29 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x41296560 self=0x4d2f38
| sysTid=17072 nice=0 sched=0/0 cgrp=default handle=10050328
| schedstat=( 0 0 0 ) utm=3 stm=1 core=1
"Thread-809" prio=5 tid=28 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4129b490 self=0x45e710
| sysTid=17071 nice=0 sched=0/0 cgrp=default handle=5146952
| schedstat=( 0 0 0 ) utm=3 stm=0 core=0
"Thread-808" prio=5 tid=27 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x412d6008 self=0x44aa48
| sysTid=17070 nice=0 sched=0/0 cgrp=default handle=3737640
| schedstat=( 0 0 0 ) utm=2 stm=0 core=0
"Thread-807" prio=5 tid=26 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x41352300 self=0x3abee0
| sysTid=17069 nice=0 sched=0/0 cgrp=default handle=5418280
| schedstat=( 0 0 0 ) utm=3 stm=0 core=1
"Thread-806" prio=5 tid=25 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x41352a00 self=0x4d0a00
| sysTid=17068 nice=0 sched=0/0 cgrp=default handle=5327520
| schedstat=( 0 0 0 ) utm=3 stm=0 core=1
"Thread-805" prio=5 tid=24 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x41352ef0 self=0x49bec8
| sysTid=17067 nice=0 sched=0/0 cgrp=default handle=6587488
| schedstat=( 0 0 0 ) utm=3 stm=0 core=1
"Thread-804" prio=5 tid=23 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4138be18 self=0x4e2c18
| sysTid=17066 nice=0 sched=0/0 cgrp=default handle=9299592
| schedstat=( 0 0 0 ) utm=3 stm=0 core=1
"Thread-803" prio=5 tid=22 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4138e5e0 self=0x483e58
| sysTid=17065 nice=0 sched=0/0 cgrp=default handle=8949624
| schedstat=( 0 0 0 ) utm=4 stm=0 core=0
"Thread-802" prio=5 tid=21 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4151b210 self=0x4b23d0
| sysTid=17064 nice=0 sched=0/0 cgrp=default handle=4798984
| schedstat=( 0 0 0 ) utm=3 stm=0 core=0
"Thread-801" prio=5 tid=20 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4151d118 self=0x492bd0
| sysTid=17063 nice=0 sched=0/0 cgrp=default handle=10231792
| schedstat=( 0 0 0 ) utm=3 stm=0 core=0
"Thread-800" prio=5 tid=19 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x416cf1f8 self=0x482808
| sysTid=17062 nice=0 sched=0/0 cgrp=default handle=1742184
| schedstat=( 0 0 0 ) utm=4 stm=0 core=1
"Thread-799" prio=5 tid=18 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x416daed8 self=0x488218
| sysTid=17061 nice=0 sched=0/0 cgrp=default handle=4954264
| schedstat=( 0 0 0 ) utm=3 stm=1 core=0
"Thread-798" prio=5 tid=17 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x40850ce8 self=0x4a9a28
| sysTid=17060 nice=0 sched=0/0 cgrp=default handle=5096688
| schedstat=( 0 0 0 ) utm=5 stm=0 core=0
"Thread-797" prio=5 tid=16 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x40870490 self=0x39e6e8
| sysTid=17059 nice=0 sched=0/0 cgrp=default handle=6489784
| schedstat=( 0 0 0 ) utm=6 stm=0 core=0
"Thread-796" prio=5 tid=15 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x40941f78 self=0x399aa8
| sysTid=17058 nice=0 sched=0/0 cgrp=default handle=8600264
| schedstat=( 0 0 0 ) utm=6 stm=0 core=0
"Thread-795" prio=5 tid=14 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4102be68 self=0x1700b8
| sysTid=17057 nice=0 sched=0/0 cgrp=default handle=9814600
| schedstat=( 0 0 0 ) utm=5 stm=0 core=1
"Thread-794" prio=5 tid=13 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x41082f70 self=0x1f78d0
| sysTid=17056 nice=0 sched=0/0 cgrp=default handle=7060200
| schedstat=( 0 0 0 ) utm=4 stm=0 core=1
"Thread-793" prio=5 tid=12 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x410dcbf0 self=0x2ef6a0
| sysTid=17055 nice=0 sched=0/0 cgrp=default handle=7993768
| schedstat=( 0 0 0 ) utm=4 stm=0 core=0
"Thread-792" prio=5 tid=11 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4113a620 self=0x5edf28
| sysTid=17054 nice=0 sched=0/0 cgrp=default handle=7291408
| schedstat=( 0 0 0 ) utm=6 stm=0 core=0
"Thread-791" prio=5 tid=10 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x4084c0a0 self=0x5c6b28
| sysTid=17053 nice=0 sched=0/0 cgrp=default handle=6171632
| schedstat=( 0 0 0 ) utm=6 stm=0 core=0
"AsyncTask #5" prio=5 tid=767 WAIT
| group="main" sCount=1 dsCount=0 obj=0x410cbcb0 self=0x85fca0
| sysTid=16758 nice=10 sched=0/0 cgrp=bg_non_interactive handle=10617808
| schedstat=( 0 0 0 ) utm=12 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x410cbe80> (a java.lang.VMThread) tid=767
at java.lang.Thread.parkFor(Thread.java:1425)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:329)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1014)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
at java.lang.Thread.run(Thread.java:1020)
"AsyncTask #4" prio=5 tid=766 WAIT
| group="main" sCount=1 dsCount=0 obj=0x4101c710 self=0x9e6ca8
| sysTid=16757 nice=10 sched=0/0 cgrp=bg_non_interactive handle=10383448
| schedstat=( 0 0 0 ) utm=36 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x41079430> (a java.lang.VMThread) tid=766
at java.lang.Thread.parkFor(Thread.java:1425)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:329)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1014)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
at java.lang.Thread.run(Thread.java:1020)
"AsyncTask #5" prio=5 tid=765 WAIT
| group="main" sCount=1 dsCount=0 obj=0x410a9788 self=0x7c0cd0
| sysTid=16738 nice=10 sched=0/0 cgrp=bg_non_interactive handle=2062320
| schedstat=( 0 0 0 ) utm=5 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x41352368> (a java.lang.VMThread) tid=765
at java.lang.Thread.parkFor(Thread.java:1425)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:329)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1014)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
at java.lang.Thread.run(Thread.java:1020)
"AsyncTask #4" prio=5 tid=411 WAIT
| group="main" sCount=1 dsCount=0 obj=0x415f0098 self=0x779eb8
| sysTid=16372 nice=10 sched=0/0 cgrp=bg_non_interactive handle=7993152
| schedstat=( 0 0 0 ) utm=47 stm=2 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x4113ed48> (a java.lang.VMThread) tid=411
at java.lang.Thread.parkFor(Thread.java:1425)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:329)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1014)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
at java.lang.Thread.run(Thread.java:1020)
"AsyncTask #3" prio=5 tid=410 WAIT
| group="main" sCount=1 dsCount=0 obj=0x411276c8 self=0x66bb20
| sysTid=16371 nice=10 sched=0/0 cgrp=bg_non_interactive handle=7590640
| schedstat=( 0 0 0 ) utm=125 stm=1 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x41127860> (a java.lang.VMThread) tid=410
at java.lang.Thread.parkFor(Thread.java:1425)
at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
at sun.misc.Unsafe.park(Unsafe.java:329)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObj...
最佳答案
ANR 是众所周知的问题。确保在 AsyncTask 中执行所有昂贵的操作,并且不要使 onCreate、onStart 或 onResume Activity 负担过重。
看Responsiveness了解更多信息。
In particular, Activities should do as little as possible to set up in key life-cycle methods such as onCreate() and onResume(). Potentially long running operations such as network or database operations, or computationally expensive calculations such as resizing bitmaps should be done in a child thread (or in the case of databases operations, via an asynchronous request). However, this does not mean that your main thread should block while waiting for the child thread to complete — nor should you call Thread.wait() or Thread.sleep(). Instead of blocking while waiting for a child thread to complete, your main thread should provide a Handler for child threads to post back to upon completion. Designing your application in this way will allow your main thread to remain responsive to input and thus avoid ANR dialogs caused by the 5 second input event timeout. These same practices should be followed for any other threads that display UI, as they are also subject to the same timeouts.
关于android - ANR keyDispatchingTimedOut,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6978964/
当我开始我的 Activity 时,我收到一个 ANR 错误。我不知道如何修复,我认为这个错误是由事件引起的。 这是错误: 01-23 12:29:29.594: E/ActivityMana
当使用 honeycomb 模拟器时显示以下错误并且变得非常慢。 02-11 02:58:50.949: ERROR/ActivityManager(365): ANR in com.android.
我遇到了一些应用程序卡住问题。看起来它与 hardwarerenderer 以及我正在使用的线程数量有关。我希望有人能查看日志并告诉我是否有任何明显的问题。谢谢。 DALVIK THREADS
我有一个应用程序在一个特定组件中不断出现 ANR,我无法弄清楚是什么占用了 CPU 时间。最近我遇到了两种 ANR,一种是原生的,一种是等待的。 DALVIK THREADS: "main" pri
我的 Android 应用程序收到有关 ANR keyDispatchingTimedOut 的错误报告。令人惊讶的是,这份报告中的堆栈跟踪不包含任何我自己的类。 我还检查了我的 onPause()
当我尝试使用 DOM 解析 RSS 时,我在我的应用程序中遇到此强制关闭错误。但这并不总是强制关闭问题...这是 logcat: **ANR keyDispatchingTimedOut** DALV
我的应用程序“ActivityManager 中的 ANR keyDispatchingTimedOut”收到以下崩溃报告。生成的 logCat 如下所示。谁能告诉我错误到底发生在哪里?我尝试了很多,
我得到了“著名的”报告ANR keyDispatchingTimedOut,我正在阅读它,但我不太明白,我想问一下。我猜这个问题是由 onCreate() 上的大量工作引起的?如果我创建一个新方法,我
我在我的开发控制台中收到了 ANR 错误的报告。我是否需要在我的服务中生成一个关闭 onSignalStrengthsChanged 的工作线程来停止长 sql 查询的 ANR? 我也不知道这是否是互
下面是 espresso 测试的一部分,当单击提交按钮时尝试登录到远程服务器,然后在成功登录后检查是否显示带有测试“ FAQ ”的 View 。 onView(withId(R.id.buttonS
我是一名优秀的程序员,十分优秀!