HeapWorker Android 性能

发布于 2024-10-10 15:38:58 字数 1277 浏览 2 评论 0原文

[ 01-01 08:29:02.954 1511:0x5e7 E/dalvikvm ]
HeapWorker is wedged: 10330ms spent inside Landroid/content/ContentResolver$CursorWrapperInner;.finalize()V
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
DALVIK THREADS:    
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
"main" prio=5 tid=1 RUNNABLE    
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
  | group="main" sCount=0 dsCount=0 s=N obj=0x400258c8 self=0xcd98
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
  | sysTid=1511 nice=0 sched=0/0 cgrp=default handle=-1345021912
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:Note: 0000662)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.lang.StringBuilder.toString(StringBuilder.java:664)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.join(File.java:264)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.<init>(File.java:175)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.<init>(File.java:142)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.filenamesToFiles(File.java:1082)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.listFiles(File.java:1008)

如何解决这个问题?

我知道根本原因是创建了太多临时变量。

[ 01-01 08:29:02.954 1511:0x5e7 E/dalvikvm ]
HeapWorker is wedged: 10330ms spent inside Landroid/content/ContentResolver$CursorWrapperInner;.finalize()V
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
DALVIK THREADS:    
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
"main" prio=5 tid=1 RUNNABLE    
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
  | group="main" sCount=0 dsCount=0 s=N obj=0x400258c8 self=0xcd98
[ 01-01 08:29:02.954 1511:0x5e7 I/dalvikvm ]
  | sysTid=1511 nice=0 sched=0/0 cgrp=default handle=-1345021912
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:Note: 0000662)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.lang.StringBuilder.toString(StringBuilder.java:664)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.join(File.java:264)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.<init>(File.java:175)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.<init>(File.java:142)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.filenamesToFiles(File.java:1082)
[ 01-01 08:29:02.977 1511:0x5e7 I/dalvikvm ]
  at java.io.File.listFiles(File.java:1008)

How to resolve this issue?

I know the root cause is to much temporary variables be created.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若能看破又如何 2024-10-17 15:38:58

您正在查看堆栈跟踪以查找错误的线程。

问题在于终结器需要超过 10 秒才能完成,因此虚拟机认为它已陷入死锁并中止以导致应用程序重新启动。在这种情况下,停止的函数是 android.content.ContentResolver.CursorWrapperInner.finalize()。

附近应该有 HeapWorker 线程的堆栈跟踪。

You're looking at the stack trace for the wrong thread.

The problem is that a finalizer took more than 10 seconds to complete, so the VM assumed it was deadlocked and aborted to cause the app to restart. In this case, the stalled function is android.content.ContentResolver.CursorWrapperInner.finalize().

There should be a stack trace for the HeapWorker thread nearby.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文