Java - memory overflow occurs when loading images using glide
PHP中文网
PHP中文网 2017-05-17 10:07:15
0
1
1028

Pending exception java.lang.OutOfMemoryError: Failed to allocate a 1125012 byte allocation with 784248 free bytes and 765KB until 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 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)
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.java:39)

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

PHP中文网
PHP中文网

认证0级讲师

reply all (1)
滿天的星座

You can’t find anything by looking at this log. There is a very high probability of OOM when loading images.
Please judge carefully
1) Are large images loaded continuously but not recycled in time?
2) Is there a memory leak somewhere?
You can try to use LeakCanary to check for memory leaks, or use tools to continuously check memory usage

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!