bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.62k stars 6.12k forks source link

out of memory... #3239

Closed sukko closed 6 years ago

sukko commented 6 years ago

out of memory

android: scaleType = "centerCrop" This does not happen if you remove the option.

http://k.kakaocdn.net/dn/OTQ4I/btqnDXVT3gI/MUokqpKv7xuoBqt52760L1/original.jpg this image size is 960x1 ..

Glide Version: implementation ("com.github.bumptech.glide:glide:4.6.1") annotationProcessor ("com.github.bumptech.glide:compiler:4.6.1") implementation ("com.github.bumptech.glide:okhttp3-integration:4.6.1"){ exclude group: "glide-parent" }

Integration libraries:

Device/Android Version: Android 4.4.2

Issue details / Repro steps / Use case background:

    GlideApp.with(MusicApplication.getInstance())
             .load("http://k.kakaocdn.net/dn/OTQ4I/btqnDXVT3gI/MUokqpKv7xuoBqt52760L1/original.jpg")
                .into(aaaa);
<RelativeLayout
    android:id="@+id/musicroom_image_layout"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:importantForAccessibility="no"
    tools:visibility="gone"
    >

    <ImageView
        android:id="@+id/aaaa"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        />

08-01 15:17:53.024 23572-23933/com.kakao.music E/dalvikvm-heap: Out of memory on a 629856016-byte allocation. 08-01 15:17:53.024 23572-23933/com.kakao.music I/dalvikvm: "glide-disk-cache-thread-0" prio=5 tid=40 RUNNABLE | group="main" sCount=0 dsCount=0 obj=0x41e60c30 self=0x7702f760 | sysTid=23933 nice=9 sched=0/0 cgrp=apps handle=1996668528 | state=R schedstat=( 0 0 0 ) utm=91 stm=4 core=1 at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:809) at android.graphics.Bitmap.createBitmap(Bitmap.java:786) at android.graphics.Bitmap.createBitmap(Bitmap.java:753) at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.createBitmap(LruBitmapPool.java:149) at com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool.getDirty(LruBitmapPool.java:142) at com.bumptech.glide.load.resource.bitmap.Downsampler.setInBitmap(Downsampler.java:688) at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeFromWrappedStreams(Downsampler.java:297) at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:207) at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:160) at com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(ByteBufferBitmapDecoder.java:33) at com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(ByteBufferBitmapDecoder.java:16) at com.bumptech.glide.load.resource.bitmap.BitmapDrawableDecoder.decode(BitmapDrawableDecoder.java:58) at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72) at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55) at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45) at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58) at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43) at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:498) at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:469) at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:455) at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:407) at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:376) at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:95) at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:74) at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:75) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:299) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:266) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

sjudd commented 6 years ago

See http://bumptech.github.io/glide/doc/debugging.html#out-of-memory-errors

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.