JavaNoober / BackgroundLibrary

A framework for directly generating shape through Tags, no need to write shape.xml again(通过标签直接生成shape,无需再写shape.xml)
Apache License 2.0
3.86k stars 469 forks source link

OutOfMemoryError #112

Closed lx36301766 closed 4 years ago

lx36301766 commented 4 years ago

Fatal Exception: java.lang.OutOfMemoryError Failed to allocate a 1960012 byte allocation with 1845312 free bytes and 1802KB until OOM dalvik.system.VMRuntime.newNonMovableArray (VMRuntime.java) androidx.appcompat.app.AppCompatDelegateImpl.onCreateView (AppCompatDelegateImpl.java:1465) com.noober.background.BackgroundFactory.onCreateView (BackgroundFactory.java:52) com.noober.background.BackgroundFactory.onCreateView (BackgroundFactory.java:374) android.view.LayoutInflater$FactoryMerger.onCreateView (LayoutInflater.java:192) android.view.LayoutInflater.inflate (LayoutInflater.java:430)

我集成的crash统计显示线上有100多个用户都报这个错,是我哪用错了吗

JavaNoober commented 4 years ago

是不是你xml里面部分资源的图片过大啊,比如imageview 设置图片内容的时候

JavaNoober commented 4 years ago

这个地方oom是调用系统原生onCreateView导致,应该和bl关系不大,你看一下是不是你有很多地方加载了大图

lx36301766 commented 4 years ago

嗯,我也觉得应该不是你的锅。。。可能还是我图片管理不当导致的