简体   繁体   English

Java-Android致命信号11 SIGSEGV

[英]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. 当创建ByeBuffers来存储openGL纹理的顶点数组时,就会发生这种情况。 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 一种可能的解决方案是通过在应用程序清单中设置android:largeHeap="true"来调查使用更大的堆大小,并记录在开发人员站点上

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. 然后,openGL API(以我为例)访问了一个无效的偏移量(在低级)并导致了分段错误,就像访问C中的无效内存一样。这在Java外部发生,因为字节缓冲区由内核管理,允许硬件和低级代码与您的内存一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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