Fresco: Fresco won't recycle the memory on Lollipop .

Created on 13 Aug 2015  路  6Comments  路  Source: facebook/fresco

I show some picture using viewpager. Viewpager item is Fragment.
Even though Fregment is detroy. GC is not occur.
Keep add Image to memory.

11

222

init Fresco

  ImagePipelineConfig config = OkHttpImagePipelineConfigFactory
                .newBuilder(this, DCB_RestfulAdapter.getClient())
                .build();
        Fresco.initialize(this, config);

showing image

 GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
            GenericDraweeHierarchy hierarchy = builder.setFadeDuration(300)
            .setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER)
            .setProgressBarImage(new CustomProgressbarDrawable(this))
            .build();

            hierarchy.setPlaceholderImage(R.drawable.ic_placeholder);


            ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
                .setResizeOptions(new ResizeOptions(Utils.getScreenWidth(getActivity()), Utils.getScreenHeight(getActivity())))
//                .setResizeOptions(new ResizeOptions(300, 300))
                .setAutoRotateEnabled(true)
                .build();


            DraweeController draweeController = Fresco.newDraweeControllerBuilder()

                    .setImageRequest(imageRequest)
                    .setAutoPlayAnimations(true)
                    .setOldController(view.getController())

                    .build();
            view.setController(draweeController);
            view.setHierarchy(hierarchy);
            view.setAspectRatio(1.33f);
bug

All 6 comments

Fresco maintains bitmap cache and it's default size limit is equal to 1/4 of the heap size. Can you confirm that Bitmaps take more space than that ?

occur OOM.

A also saw strange behaviour on Lollipop (Nexus 5). Images inside RecyclerView became black, scrolling became slow after some usage. And then app crashes if I continue to scroll this collection of images. Looks like after close/open this Fragment with images Fresco do not free memory.

@DASAR yes, that situation also happened in all my Lolliopop version cellphones.

+1

Closing due to lack of updates.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

satyarths picture satyarths  路  3Comments

cococool picture cococool  路  4Comments

eresid picture eresid  路  4Comments

amodkanthe picture amodkanthe  路  3Comments

goodev picture goodev  路  4Comments