HeapWorker Android 性能
[ 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在查看堆栈跟踪以查找错误的线程。
问题在于终结器需要超过 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.