1

在运行我的 android 应用程序时,LogCat 会写入警告和信息日志,它们会影响我的应用程序的性能还是只需要忽略它们?

当我尝试从我使用ByteArrayOutputStream () 并且我还使用AsyncTask更新 GUI 的音频文件中写入和读取时会发生这种情况。从 LogCat 我了解到它与线程有关,但它是如何导致的?请看下面的logcat

    05-04 16:41:17.645: W/dalvikvm(2030): threadid=3: spin on suspend #0 threadid=23 (h=4332248)
05-04 16:41:17.645: W/dalvikvm(2030): dumping state: process - 2030
05-04 16:41:17.645: I/dalvikvm(2030): "main" prio=5 tid=3 RUNNABLE
05-04 16:41:17.645: I/dalvikvm(2030):   | group="main" sCount=0 dsCount=0 s=N obj=0x4001b268 self=0xbd00
05-04 16:41:17.645: I/dalvikvm(2030):   | sysTid=2030 nice=0 sched=0/0 cgrp=default handle=-1344001384
05-04 16:41:17.645: I/dalvikvm(2030):   at com.m2.gui.player.readData(Native Method)
05-04 16:41:17.645: I/dalvikvm(2030):   at com.m2.gui.player.onCreate(player.java:149)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.app.ActivityThread.access$2200(ActivityThread.java:119)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.os.Handler.dispatchMessage(Handler.java:99)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.os.Looper.loop(Looper.java:123)
05-04 16:41:17.645: I/dalvikvm(2030):   at android.app.ActivityThread.main(ActivityThread.java:4363)
05-04 16:41:17.645: I/dalvikvm(2030):   at java.lang.reflect.Method.invokeNative(Native Method)
05-04 16:41:17.645: I/dalvikvm(2030):   at java.lang.reflect.Method.invoke(Method.java:521)
05-04 16:41:17.645: I/dalvikvm(2030):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-04 16:41:17.645: I/dalvikvm(2030):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-04 16:41:17.645: I/dalvikvm(2030):   at dalvik.system.NativeStart.main(Native Method)
05-04 16:41:17.645: I/dalvikvm(2030): "AsyncTask #4" prio=5 tid=23 RUNNABLE
05-04 16:41:17.645: I/dalvikvm(2030):   | group="main" sCount=1 dsCount=0 s=N obj=0x44f2c048 self=0x4219c0
05-04 16:41:17.645: I/dalvikvm(2030):   | sysTid=2280 nice=10 sched=0/0 cgrp=bg_non_interactive handle=4332248
05-04 16:41:17.894: I/dalvikvm(2030):   at com.m2.gui.player$progressUpdate.doInBackground(player.java:-1)
05-04 16:41:17.894: I/dalvikvm(2030):   at com.m2.gui.player$progressUpdate.doInBackground(player.java:1)
05-04 16:41:17.894: I/dalvikvm(2030):   at android.os.AsyncTask$2.call(AsyncTask.java:185)
05-04 16:41:17.894: I/dalvikvm(2030):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
05-04 16:41:17.894: I/dalvikvm(2030):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
05-04 16:41:17.894: I/dalvikvm(2030):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
05-04 16:41:17.894: I/dalvikvm(2030):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
05-04 16:41:17.894: I/dalvikvm(2030):   at java.lang.Thread.run(Thread.java:1096)
05-04 16:41:17.912: W/dalvikvm(2030): threadid=3: spin on suspend resolved in 515 msec
4

1 回答 1

0

它们会影响我的应用程序的性能吗?

在实际设备上登录使用滚动机制,缓冲区大小为 64KB,从我的角度来看,它应该不会对您的应用程序性能造成太大影响。

或者只是需要忽略它们?

您发布的 logcat 基本上是来自底层 dalvikvm 关于线程运行信息和状态的详细消息,我在这里看不到与您的应用程序相关的任何问题,我认为您可以简单地忽略它。如果你将安卓手机连接到你的开发机器然后执行一些操作并检查出来,你会看到系统记录了很多详细的消息,比如屏幕打开/关闭、活动创建/销毁等。

于 2012-05-04T11:55:53.827 回答