Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 629 (example.testpro)
2016-10-20 09:48
399 查看
Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 629 (example.testpro)
产生原因:编写Android程序有需要加载大量图片(同次出现30张左右图片)造成的程序闪退。错误提示:

解决方法:
原文:
The real error is Out of memory on a 23818256-byte allocation. You are attempting to allocate a ~22MB block of memory, and you do not have that much free memory available, let alone a contiguous block that large.
In this case, this is coming from a drawable resource. ~22MB would be a truly massive image, more like 2400x2400 than 1200x1200.
Your process heap size is 48MB, which is substantial, but ~22MB is almost half your heap budget.
I would recommend that you find out which drawable resource this is (looks like it might be a background of a RelativeLayout), then reduce its size and the sizes of similar images. Here, by “size” I mean total pixel count, not the on-disk size, as what matters is the decompressed size in RAM, not how big the image is on disk.
Also, this might be an issue of resource directories. For example, if you put your 1200x1200 image in res/drawable/, that effectively is synonymous with res/drawable-mdpi/. If this device happens to be an -xhdpi device, then that would explain the memory usage, as Android will try to upsample this image and double each of the dimensions.
原文链接: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 32140
大意:
主要说明图片所占 **巨大** 内存造成的内存溢出,是程序闪退的原因
解决方法:
主要提供两种方法:
通过降低图片的像素,例如将原1200*1200的图片降低为200*200, 目的是为了降低在RAM中解压后体积。
通过适配屏幕分辨率的图片放置位置,例如1200*1200像素的图片放置在-mdpi/,而设备为 -xhdpi 分辨率,则Android会尝试上传并将它的每个纬度扩张1倍.
由于只是一个demo,我所使用所以只是简单的将所有图片在每个 drawable/ 下放置一份。
可以看到图片的要占内存大大减小
事实上如果要尝试正确匹配,应当了解不同分辨率下屏幕图片的要求,特别是在平板 与 手机端都需要兼容的情况下。
相关文章推荐
- Android Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread
- Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4358 (CameraPreviewTh)问题解决
- android native开发 错误信息定位:Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 4785 (XXX)
- A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 25427 (pool-1-thread-2)
- Fatal signal 11 (SIGSEGV) at 0x00000014 (code=1), thread 29925 (cloud.diversion)
- android开发录音时出现Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1), thread 16909 (umu.mediarecord)的解决方案
- 解决F/libc ( 953): Fatal signal 11 (SIGSEGV) at 0x00000003 (code=1), thread 1720 问题
- 求大神相助,关于 Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1531
- Fatal signal 11 (SIGSEGV) at 0xccf0001d (code=1)
- 关于cocos2dx 3.0升级崩溃报错(unable to load native library) 和(Fatal signal 11 (SIGSEGV) at 0x00000000)
- JNI:Fatal signal 11 (SIGSEGV) at 0x00000008 (code=1)错误的一点认识
- Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)问题解决
- Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) 错误 解决方案(android-ndk)
- Fatal signal 11 (SIGSEGV) at 0x000007c4 (code=1)
- Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) 指针内存问题
- Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1755 (CrBrowserMain)问题
- Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 16169 (Thread-1035)
- Fatal signal 11 (SIGSEGV) at 0x390955ae (code=1)
- Android Studio异常:Fatal signal 11 (SIGSEGV) at 0x000000b4 (code=1)
- Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)问题解决