待處理異常java.lang.OutOfMemoryError:無法分配1125012 位元組分配,其中有784248 個可用位元組和765KB,直到OOM
com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream,android. graphics.BitmapFactory$Options , com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool, int, int, int, com.bumptech.glide.load.DecodeFormat) (Downsampler.java:217)##at androidgraphics##d .Bitmap com.bumptech .glide.load.resource.bitmap.Downsampler.decode(java.io.InputStream, com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool, int, int, com.bumptech.glide.load. DecodeFormat) (Downsampler. java:151)
at com.bumptech.glide.load.engine.Resource com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(java.io.InputStream, int, int) (StreamBitmapDecoder.java: 50)
at com.bumptech.glide.load.engine.Resource com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(java.lang.Object, int, int) (StreamBitmapDecoder .java:19)
at com.bumptech.glide.load.engine.Resource com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(com.bumptech.glide.load.model.ImageVideoWrapper, int, int) (ImageVideoBitmapDecoder.爪哇:39)
滿天的星座2017-05-17 10:09:15
看這個log並不能發現什麼,圖片載入出現oom是非常高機率的。
請仔細判斷
1)是否連續的加載了大圖而沒有及時回收?
2)是否哪裡記憶體洩漏了?
可以嘗試用LeakCanary檢查下記憶體洩漏,或是用工具持續檢查記憶體佔用狀況