Hi,Fresco.
First of all ,thanks for this amazing Android Image Loading Framework!
Here is the problems happened to me:
When I use SimpleDraweeView in ListView,loading android SD files,normally I scroll it ,nothing weird happens,but when I fast scroll it ,log tells me :
"unknown:CloseableReference﹕ Finalized without closing: 42d7b6a8 42d7b718 (type = NativePooledByteBuffer)"
according to the issue #213 ,Using SimpleDraweeView will not encountered this problem,can you help me?
Can you tell us what version of Android and what device you are using?
Android 4.4.2 & zte v5max the same issue
Hi Fresco,
I am also getting same issue. Can you please help us to overcome this issue. i am using lib to show gif images in grid view. Thanks in advance.
Hi!
"Finalized without closing" indicates an issue, but the image should still be displayed properly, and the resources should still be cleaned up properly (just later than we would like to). Is that not the case? I mean, is the only thing that bothers you this logcat line, or do you actually have some issues with displaying images?
Are those GIFs animated? Also, can you provide some more context on how you use Fresco? XML, code, etc.
I am also getting same issue.
my code is
Uri uri = imageModel.getImgPath();
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri)
.setResizeOptions(new ResizeOptions(mItemWidth, mItemWidth))
.setAutoRotateEnabled(true)
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(holder.img.getController())
.build();
holder.img.setController(controller);
and the image is local camera images
@crianzy are you using a RecyclerView?
I am using SimpleDrawee to load local Image such as 'file://XXX'(NOT show when load a Image in NetWork) in RecycleView.When I scroll RecycleView the log show ''W/unknown:CloseableReference﹕ Finalized without closing: 43002710 430025b8 (type = NativePooledByteBuffer)"
load Image code:
public static void displayImage(File image, SimpleDraweeView imageView, ResizeOptions options){
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.fromFile(image))
.setResizeOptions(options)
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setOldController(imageView.getController())
.setImageRequest(request)
.build();
imageView.setAspectRatio((float) options.height / options.width);
imageView.setController(controller);
}
and recycle code:
@Override
public void onViewRecycled(RecyclerView.ViewHolder holder) {
if (holder != null && holder instanceof ImageItemViewHolder && ((ImageItemViewHolder) holder).mItemLayout != null) {
((ImageItemViewHolder) holder).mItemLayout.setImageNull();
}
}
Hi
I use recycleview
i want to loading local images
file://~~~
19787-19805/com.seedsocial.seedgirl W/art﹕ Suspending all threads took: 5.509ms
01-19 12:41:18.117 19787-19787/com.seedsocial.seedgirl I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@1cff8904 time:74844492
01-19 12:41:18.128 19787-24125/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307756: onProducerFinishWithFailure: {requestId: 14, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 193704004 Free size = 0 Request size = 51916800}
01-19 12:41:18.128 19787-24125/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307756: onRequestFailure: {requestId: 14, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 193704004 Free size = 0 Request size = 51916800}
01-19 12:41:18.130 19787-24125/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307758: onProducerFinishWithFailure: {requestId: 16, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 193704004 Free size = 0 Request size = 14745600}
01-19 12:41:18.130 19787-24125/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307758: onRequestFailure: {requestId: 16, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 193704004 Free size = 0 Request size = 14745600}
01-19 12:41:18.176 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307804: onProducerFinishWithFailure: {requestId: 23, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 6998400}
01-19 12:41:18.176 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307804: onRequestFailure: {requestId: 23, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 6998400}
01-19 12:41:18.179 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307807: onProducerFinishWithFailure: {requestId: 25, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 1658880}
01-19 12:41:18.179 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307807: onRequestFailure: {requestId: 25, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 1658880}
01-19 12:41:18.184 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307812: onProducerFinishWithFailure: {requestId: 26, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 1658880}
01-19 12:41:18.184 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307813: onRequestFailure: {requestId: 26, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 1658880}
01-19 12:41:18.185 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307814: onProducerFinishWithFailure: {requestId: 27, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.185 19787-24121/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259307814: onRequestFailure: {requestId: 27, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.936 19787-19854/com.seedsocial.seedgirl E/libGameXtend﹕ LUCID ERROR in reading /sys/devices/virtual/thermal/thermal_zone0/temp
01-19 12:41:18.968 19787-19787/com.seedsocial.seedgirl I/Choreographer﹕ Skipped 40 frames! The application may be doing too much work on its main thread.
01-19 12:41:18.970 19787-24125/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259308598: onProducerFinishWithFailure: {requestId: 28, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.970 19787-24125/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259308598: onRequestFailure: {requestId: 28, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.982 19787-24122/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259308610: onProducerFinishWithFailure: {requestId: 30, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.982 19787-24122/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259308610: onRequestFailure: {requestId: 30, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.988 19787-24127/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259308617: onProducerFinishWithFailure: {requestId: 29, stage: DecodeProducer, elapsedTime: -1 ms, extraMap: null, throwable: com.facebook.imagepipeline.memory.BasePool$PoolSizeViolationException: Pool hard cap violation? Hard cap = 201326592 Used size = 200877284 Free size = 0 Request size = 33177600}
01-19 12:41:18.988 19787-24127/com.seedsocial.seedgirl W/unknown:RequestLoggingListener﹕ time 259308617: onRequestFailure: {requestId: 29, elapsedTime: -1 ms, throwable: com.facebook.imagepipeline.memory
is this bug fixed ?
I am code :
Uri uri = Uri.fromFile(new File(path));
ImageRequestBuilder imageRequestBuilder = ImageRequestBuilder.newBuilderWithSource(uri)
.setAutoRotateEnabled(true)
.setResizeOptions(new ResizeOptions(mItemWidth, mItemWidth));
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(imageRequestBuilder.build())
.setOldController(holder.mImageView.getController())
.build();
holder.mImageView.setController(controller);
has the same bug in gridview
I might find the reason.(in version 0.8.1,still exists in 0.9)
in the CloseableReference.finalize
protected void finalize() throws Throwable {
try {
synchronized(this) {
if(this.mIsClosed) {
return;
}
}
FLog.w(TAG, "Finalized without closing: %x %x (type = %s)", new Object[]{Integer.valueOf(System.identityHashCode(this)), Integer.valueOf(System.identityHashCode(this.mSharedReference)), this.mSharedReference.get().getClass().getSimpleName()});
this.close();
} finally {
super.finalize();
}
}
the log printing is not in thatsynchronized block.
but in ListView/RecycleView,load images is asynchronous.
Are the other threads print the waring log?
@tyronen
how to solve the bug?
how to solve the bug?
@tqlmorepassion @helengray @ChenSiLiang and all the others.
Can you do me a favour and install https://github.com/square/leakcanary so that we can find out where the code leaks?
Seems like there's a known issue where Android doesn't call onDetachedFromWindow() in some cases:
https://code.google.com/p/android/issues/detail?id=5708
This is the only situation where this would manifest. As @plamenko said, this isn't a bug, the objects just get cleaned up a bit later. Closing for now because there's not much we can do about it.
I am still facing this issue and screen flickers because of this, any solution ?
Most helpful comment
how to solve the bug?