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)

如何解决这个问题?

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

4

1 回答 1

3

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.

于 2011-01-07T22:43:41.657 回答