-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native crash Segmentation fault #631
Comments
this is my config public class GlideConfiguration extends VolleyGlideModule {
public static int MAX_MEMORY_CACHE_SIZE = 10*1024*1024;
public static int MAX_BITMAP_POOL_SIZE = 12*1024*1024;
@Override
public void applyOptions(Context context, GlideBuilder builder) {
// Do nothing.
MemorySizeCalculator calculator = new MemorySizeCalculator(context);
int defaultMemoryCacheSize = calculator.getMemoryCacheSize();
int defaultBitmapPoolSize = calculator.getBitmapPoolSize();
Timber.i("defaultMemoryCacheSize %d defaultBitmapPoolSize %d", defaultMemoryCacheSize, defaultBitmapPoolSize);
builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888)
.setResizeService(new FifoPriorityThreadPoolExecutor(2))
.setDiskCache(new InternalCacheDiskCacheFactory(context, 250 * 1024 * 1024))
.setMemoryCache(new LruResourceCache(Math.min(MAX_MEMORY_CACHE_SIZE, defaultMemoryCacheSize)))
.setBitmapPool(new LruBitmapPool(Math.min(MAX_BITMAP_POOL_SIZE, defaultBitmapPoolSize)));
}
@Override
public void registerComponents(Context context, Glide glide) {
super.registerComponents(context, glide);
}
} |
That's not a native crash, that's an OutOfMemoryError followed by a native crash. Solve the memory problem and the native crash with disappear. |
@TWiStErRob I have not idea to solve the problem |
The only thing I can imagine is watching the LogCat view while running the app, and when it's close to OOM take a heap dump and investigate what's taking up so much memory. It may be a leaked activity holding on to unnecessary bitmaps for example. Check these: |
Yup OOM is definitely the issue. If you identify a memory leak in Glide, please feel free to re-open. |
maybe leak |
The text was updated successfully, but these errors were encountered: