Java - un débordement de mémoire se produit lors du chargement d'images à l'aide de Glide
PHP中文网
PHP中文网 2017-05-17 10:07:15
0
1
1030

Exception en attente java.lang.OutOfMemoryError : échec de l'allocation d'une allocation de 1125 012 octets avec 784 248 octets libres et 765 Ko jusqu'à 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)
sur android.graphics.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)
à com.bumptech.glide.load.engine.Resource com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(java.io.InputStream, int, int) (StreamBitmapDecoder.java:50)
sur com.bumptech. glide.load.engine.Resource com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(java.lang.Object, int, int) (StreamBitmapDecoder.java:19)
sur com.bumptech.glide.load. engine.Resource com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(com.bumptech.glide.load.model.ImageVideoWrapper, int, int) (ImageVideoBitmapDecoder.java:39)

谁有解决方法,发给我谢谢

PHP中文网
PHP中文网

认证0级讲师

répondre à tous (1)
滿天的星座

看这个log并不能发现什么,图片加载出现oom是非常高概率的。
请仔细判断
1)是否连续的加载了大图而没有及时回收?
2)是否哪里内存泄漏了?
可以尝试用LeakCanary检查下内存泄漏,或者用工具持续检查内存占用状况

    Derniers téléchargements
    Plus>
    effets Web
    Code source du site Web
    Matériel du site Web
    Modèle frontal
    À propos de nous Clause de non-responsabilité Sitemap
    Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!