4

我有一个库项目和一些单元测试。在模拟器 v1.6 上运行单元测试时,我得到“LinearAlloc 超出容量,last=3136”崩溃。相同的测试项目在模拟器 v2.1 及更高版本上运行良好。

有没有办法解决这个问题?

请参阅堆栈跟踪:

05-02 11:27:01.450: E/dalvikvm(558): LinearAlloc exceeded capacity, last=3136
05-02 11:27:01.450: E/dalvikvm(558): VM aborting
05-02 11:27:01.550: I/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-02 11:27:01.550: I/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:1.6/Donut/20842:eng/test-keys'
05-02 11:27:01.550: I/DEBUG(28): pid: 558, tid: 574  >>> com.***.android <<<
05-02 11:27:01.550: I/DEBUG(28): signal 11 (SIGSEGV), fault addr deadd00d
05-02 11:27:01.550: I/DEBUG(28):  r0 0000032c  r1 80000000  r2 0000000c  r3 00000026
05-02 11:27:01.550: I/DEBUG(28):  r4 deadd00d  r5 00400088  r6 ad083e1c  r7 003ff43c
05-02 11:27:01.550: I/DEBUG(28):  r8 00003071  r9 002ab040  10 424bfd00  fp 00000001
05-02 11:27:01.550: I/DEBUG(28):  ip ad083ef8  sp 45089c50  lr afe13f0d  pc ad03b7fa  cpsr 20000030
05-02 11:27:01.680: I/DEBUG(28):          #00  pc 0003b7fa  /system/lib/libdvm.so
05-02 11:27:01.690: I/DEBUG(28):          #01  pc 00042892  /system/lib/libdvm.so
05-02 11:27:01.690: I/DEBUG(28):          #02  pc 00060a10  /system/lib/libdvm.so
05-02 11:27:01.700: I/DEBUG(28):          #03  pc 00059f10  /system/lib/libdvm.so
05-02 11:27:01.700: I/DEBUG(28):          #04  pc 00013198  /system/lib/libdvm.so
05-02 11:27:01.700: I/DEBUG(28):          #05  pc 00017be4  /system/lib/libdvm.so
05-02 11:27:01.700: I/DEBUG(28):          #06  pc 0001762c  /system/lib/libdvm.so
05-02 11:27:01.700: I/DEBUG(28):          #07  pc 000529a8  /system/lib/libdvm.so
05-02 11:27:01.710: I/DEBUG(28):          #08  pc 00059eda  /system/lib/libdvm.so
05-02 11:27:01.710: I/DEBUG(28):          #09  pc 00013198  /system/lib/libdvm.so
05-02 11:27:01.710: I/DEBUG(28):          #10  pc 00017be4  /system/lib/libdvm.so
05-02 11:27:01.710: I/DEBUG(28):          #11  pc 0001762c  /system/lib/libdvm.so
05-02 11:27:01.720: I/DEBUG(28):          #12  pc 0005282c  /system/lib/libdvm.so
05-02 11:27:01.720: I/DEBUG(28):          #13  pc 0005284a  /system/lib/libdvm.so
05-02 11:27:01.720: I/DEBUG(28):          #14  pc 00047800  /system/lib/libdvm.so
05-02 11:27:01.720: I/DEBUG(28):          #15  pc 0000f940  /system/lib/libc.so
05-02 11:27:01.720: I/DEBUG(28):          #16  pc 0000f4b4  /system/lib/libc.so
05-02 11:27:01.730: I/DEBUG(28): stack:
05-02 11:27:01.730: I/DEBUG(28):     45089c10  000b1210  [heap]
05-02 11:27:01.730: I/DEBUG(28):     45089c14  afe12f59  /system/lib/libc.so
05-02 11:27:01.730: I/DEBUG(28):     45089c18  afe39f90  /system/lib/libc.so
05-02 11:27:01.730: I/DEBUG(28):     45089c1c  afe39fe4  /system/lib/libc.so
05-02 11:27:01.730: I/DEBUG(28):     45089c20  00000000  
05-02 11:27:01.730: I/DEBUG(28):     45089c24  afe13f0d  /system/lib/libc.so
05-02 11:27:01.730: I/DEBUG(28):     45089c28  0000000d  
05-02 11:27:01.730: I/DEBUG(28):     45089c2c  afe12f29  /system/lib/libc.so
05-02 11:27:01.730: I/DEBUG(28):     45089c30  000111b8  [heap]
05-02 11:27:01.740: I/DEBUG(28):     45089c34  ad083e1c  /system/lib/libdvm.so
05-02 11:27:01.740: I/DEBUG(28):     45089c38  00400088  [heap]
05-02 11:27:01.740: I/DEBUG(28):     45089c3c  ad083e1c  /system/lib/libdvm.so
05-02 11:27:01.740: I/DEBUG(28):     45089c40  003ff43c  [heap]
05-02 11:27:01.740: I/DEBUG(28):     45089c44  afe12f8d  /system/lib/libc.so
05-02 11:27:01.740: I/DEBUG(28):     45089c48  df002777  
05-02 11:27:01.740: I/DEBUG(28):     45089c4c  e3a070ad  
05-02 11:27:01.740: I/DEBUG(28): #00 45089c50  000111b8  [heap]
05-02 11:27:01.740: I/DEBUG(28):     45089c54  ad042897  /system/lib/libdvm.so
05-02 11:27:01.740: I/DEBUG(28): #01 45089c58  ad083e1c  /system/lib/libdvm.so
05-02 11:27:01.740: I/DEBUG(28):     45089c5c  00000001  
05-02 11:27:01.740: I/DEBUG(28):     45089c60  00000c40  
05-02 11:27:01.750: I/DEBUG(28):     45089c64  0000000a  
05-02 11:27:01.750: I/DEBUG(28):     45089c68  00400084  [heap]
05-02 11:27:01.750: I/DEBUG(28):     45089c6c  000111bc  [heap]
05-02 11:27:01.750: I/DEBUG(28):     45089c70  5000121c  
05-02 11:27:01.750: I/DEBUG(28):     45089c74  000001c0  
05-02 11:27:01.750: I/DEBUG(28):     45089c78  ad083e1c  /system/lib/libdvm.so
05-02 11:27:01.750: I/DEBUG(28):     45089c7c  43ed1790  /dev/ashmem/mspace/dalvik-heap/2 (deleted)
05-02 11:27:01.760: I/DEBUG(28):     45089c80  4144b400  /dev/ashmem/dalvik-LinearAlloc (deleted)
05-02 11:27:01.760: I/DEBUG(28):     45089c84  ad060a15  /system/lib/libdvm.so
05-02 11:27:01.810: D/dalvikvm(551): GC freed 10165 objects / 534720 bytes in 36ms
05-02 11:27:03.019: D/dalvikvm(551): GC freed 9963 objects / 523736 bytes in 54ms
05-02 11:27:07.659: D/Zygote(30): Process 558 terminated by signal (11)
05-02 11:27:07.670: I/ActivityManager(68): Process com.***.android (pid 558) has died.
05-02 11:27:07.670: W/ActivityManager(68): Crash of app com.***.android running instrumentation ComponentInfo{com.***.android.test/android.test.InstrumentationTestRunner}
05-02 11:27:07.670: D/ActivityManager(68): Uninstalling process com.***.android
05-02 11:27:07.680: D/AndroidRuntime(551): Shutting down VM
05-02 11:27:07.680: D/dalvikvm(551): DestroyJavaVM waiting for non-daemon threads to exit
05-02 11:27:07.680: D/dalvikvm(551): DestroyJavaVM shutting VM down
05-02 11:27:07.680: D/dalvikvm(551): HeapWorker thread shutting down
05-02 11:27:07.680: D/dalvikvm(551): HeapWorker thread has shut down
05-02 11:27:07.680: D/jdwp(551): JDWP shutting down net...
05-02 11:27:07.680: D/jdwp(551): Got wake-up signal, bailing out of select
05-02 11:27:07.680: I/dalvikvm(551): Debugger has detached; object registry had 1 entries
05-02 11:27:07.680: D/dalvikvm(551): VM cleaning up
05-02 11:27:07.690: D/dalvikvm(551): LinearAlloc 0x0 used 684532 of 4194304 (16%)
4

1 回答 1

0

同样的问题,我发现了这个:

“这是在异常复杂的界面层次结构上触发的 Dalvik 限制。

http://code.google.com/p/android/issues/detail?id=22586

有关解决方法的想法,请参阅详细信息。简单的答案可能是尝试使用不太复杂的不同库。

修复程序已合并到 Android AOSP。https://android-review.googlesource.com/#/c/30900/ "

于 2012-06-20T01:05:22.247 回答