简体   繁体   中英

Java - Android fatal signal 11 SIGSEGV

08-30 14:24:14.281: D/dalvikvm(2777): GC_FOR_ALLOC freed 6319K, 41% free 9950K/16724K, paused 12ms, total 12ms
08-30 14:24:14.281: I/dalvikvm-heap(2777): Grow heap (frag case) to 13.750MB for 4194320-byte allocation
08-30 14:24:14.291: D/dalvikvm(2777): GC_FOR_ALLOC freed <1K, 17% free 14045K/16724K, paused 13ms, total 13ms
08-30 14:24:14.381: D/dalvikvm(2777): GC_FOR_ALLOC freed 5122K, 30% free 9955K/14152K, paused 12ms, total 12ms
08-30 14:24:14.381: I/dalvikvm-heap(2777): Grow heap (frag case) to 13.755MB for 4194320-byte allocation
08-30 14:24:14.391: D/dalvikvm(2777): GC_FOR_ALLOC freed <1K, 1% free 14051K/14152K, paused 13ms, total 13ms
08-30 14:24:14.451: D/dalvikvm(2777): GC_FOR_ALLOC freed 5122K, 2% free 8933K/9032K, paused 14ms, total 14ms
08-30 14:24:14.461: I/dalvikvm-heap(2777): Grow heap (frag case) to 12.273MB for 3686416-byte allocation
08-30 14:24:14.471: D/dalvikvm(2777): GC_FOR_ALLOC freed <1K, 1% free 12533K/12636K, paused 12ms, total 12ms
08-30 14:24:14.731: D/dalvikvm(2777): GC_FOR_ALLOC freed <1K, 1% free 12533K/12636K, paused 12ms, total 12ms
08-30 14:24:14.761: I/dalvikvm-heap(2777): Grow heap (frag case) to 26.335MB for 14745616-byte allocation
08-30 14:24:14.781: D/dalvikvm(2777): GC_FOR_ALLOC freed 0K, 1% free 26933K/27040K, paused 14ms, total 14ms
08-30 14:24:27.525: A/libc(2777): Fatal signal 11 (SIGSEGV) at 0x43337b60 (code=2), thread 2797 (Thread-202)

It happens when ByeBuffers are created to store vertex arrays for openGL textures. How do I deal with this? It happens on two of my devices.

You can see from the last Garbage Collection call that the garbage collector has failed to free any memory and that you you have no memory available. How big are your buffers? How much additional head room do they need?

One possible solution is to investigate using the larger heap size by setting android:largeHeap="true" in your application manifest, documented on the developer site

The answer was that the buffer wasn't big enough. Then the openGL API (in my case) accessed an invalid offset (in low-level) and caused a segmentation fault, just like one would get for accessing invalid memory in C. This happens outside of java because bytebuffers are managed by the kernel to allow hardware and low-level code work with your memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM