Comments (6)
Same here and if I continueud my app crashed with:
FATAL EXCEPTION: Thread-28383
java.lang.OutOfMemoryError: Failed to allocate a 2789388 byte allocation with 1797128 free bytes and 1755KB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:831)
at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:55)
at com.facebook.imagepipeline.memory.BitmapPool.alloc(BitmapPool.java:30)
at com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:259)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeStaticImageFromStream(ArtDecoder.java:137)
at com.facebook.imagepipeline.platform.ArtDecoder.decodeJPEGFromEncodedImage(ArtDecoder.java:120)
at com.facebook.imagepipeline.decoder.ImageDecoder.decodeJpeg(ImageDecoder.java:154)
at com.facebook.imagepipeline.decoder.ImageDecoder.decodeImage(ImageDecoder.java:85)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:194)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:97)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:129)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:27)
at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
at java.lang.Thread.run(Thread.java:818)
I guess there is a memory leak
from frescoimageviewer.
Hi guys!
According to Fresco support, they aren't supports large images without resizing, but it will be bad for image quality when it zoomed in. If you use really big images, try to use android:largeHeap="true"
and(or) setDownsampleEnabled(true)
as the workaround. I've tested it with 4k images on emulator with 512 of RAM and OOM wasn't occurred, but nevertheless lags are still present.
Anyway, I agree that library, that gives you zooming opportunity must support such case well. And only one idea that I have is to use library Subsampling Scale Image View, but it works only with local images. I've tried to find modified version for DraweeViews, but only thing that I've found is this issue.
I'll add this to my to-do list, but i don't know, when I'll have enough time for this. However, any ideas are welcome.
from frescoimageviewer.
kotlin:
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val imagePipelineConfig = ImagePipelineConfig.newBuilder(context.getApplicationContext())
.setBitmapMemoryCacheParamsSupplier(LollipopBitmapMemoryCacheParamsSupplier(activityManager))
.setDownsampleEnabled(true)
.build()
Fresco.initialize(context.getApplicationContext(), imagePipelineConfig)
I did the down-sample workaround but still the error occurs if I swipe too many times (i've got a gallery with 300+ images).
I guess there is no truncating of old images
But it does solve te 4000x4000 image problem.
from frescoimageviewer.
Yep, finally i caught it, thanx! :)
I've tried with 1000 different images and after fast swiping of ~300 images it crashed. I'll see what I can do with this.
from frescoimageviewer.
I've fixed this leak and now all is working fine.
@spidfire Please, update library version to 0.4.0 and thanks for feedback!
from frescoimageviewer.
from frescoimageviewer.
Related Issues (20)
- blocking ui thread
- How to disable cache?
- not support none androidx project HOT 2
- not support gif
- Doesn't show image in release version HOT 2
- Fresco Slider
- When user tap on image multiple times with very short time span, i'm using onClickListener with debounce though but still this "lateinit property transitionImageAnimator has not been initialized" is happening
- R$color.class
- ImageViewer.java#onKey Override consumed volumn action
- FLAG_SECURE is not working [Android 10]
- set overlay view position HOT 1
- On opening image viewer there is a crash on few devices HOT 1
- Need Progaurd HOT 2
- Change the currently displayed image index/position through a setter (needed for adding a horizontal thumbnail gallery at the bottom of the fullscreen overlay)
- Not working on API 28 (9.0) HOT 1
- Implement back button in toolbar HOT 1
- Images are not loading after pulishing to play market HOT 2
- ZoomableDraweeView Crash
- Fatal Exception: kotlin.UninitializedPropertyAccessException lateinit property transitionImageAnimator has not been initialized HOT 4
- IllegalArgumentException when dismissing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frescoimageviewer.