Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TooManyBitmapsException #1481

Closed
anastr opened this issue Sep 27, 2016 · 3 comments
Closed

fix TooManyBitmapsException #1481

anastr opened this issue Sep 27, 2016 · 3 comments
Labels
needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem)

Comments

@anastr
Copy link

anastr commented Sep 27, 2016

i tried to load just 3 photos (Local images) using SimpleDraweeView, But it is display just the first picture ...
the code :

PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
        controller.setUri(uri);
        controller.setOldController(draweeView.getController());
        controller.setControllerListener(new BaseControllerListener<ImageInfo>() {
            @Override
            public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
                super.onFinalImageSet(id, imageInfo, animatable);
                if (imageInfo == null) {
                    return;
                }
                // ....
            }

            @Override
            public void onFailure(String id, Throwable throwable) {
                super.onFailure(id, throwable);
                throwable.printStackTrace();
            }
        });
        draweeView.setController(controller.build());

throwable print TooManyBitmapsException .....

i tried to remove memory cashed , it didn't work ...
image's size between (2500 - 3000 px) and i don't need to resize any one.
So please, we need a solution.

@kirwan
Copy link
Contributor

kirwan commented Sep 27, 2016

You say you've only attempted to load three images, but that exception should only be thrown once you've created 384 bitmaps.

Are you absolutely sure you're not loading any other images within your app which aren't being released?

@kirwan kirwan added the needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem) label Sep 27, 2016
@anastr
Copy link
Author

anastr commented Sep 27, 2016

no nothing from this.
actually, it is just three, in ViewPager...

it is happen just when image's width or height > 2500 .
image size on disk 2MB.
these are all lines :

com.facebook.imagepipeline.common.TooManyBitmapsException
    at com.facebook.imagepipeline.platform.DalvikPurgeableDecoder.pinBitmap(DalvikPurgeableDecoder.java:162)
    at com.facebook.imagepipeline.platform.KitKatPurgeableDecoder.pinBitmap(KitKatPurgeableDecoder.java:32)
    at com.facebook.imagepipeline.platform.DalvikPurgeableDecoder.decodeJPEGFromEncodedImage(DalvikPurgeableDecoder.java:90)
    at com.facebook.imagepipeline.platform.KitKatPurgeableDecoder.decodeJPEGFromEncodedImage(KitKatPurgeableDecoder.java:32)
    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:1076)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
    at java.lang.Thread.run(Thread.java:856)

@anastr
Copy link
Author

anastr commented Aug 31, 2017

It turned out that I was using a library that called Fresco.initialize(context); method.
thanks.

@anastr anastr closed this as completed Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-details This issue or PR is currently not actionable as it misses details (e.g. for reproducing the problem)
Projects
None yet
Development

No branches or pull requests

2 participants