flutter_cached_network_image icon indicating copy to clipboard operation
flutter_cached_network_image copied to clipboard

Picture download memory explosion

Open baneyue opened this issue 4 years ago • 11 comments

🐛 Bug Report

When I am on Windows platform, listview has 7000 pieces of data and loads pictures. The size of each picture is about 100kb. I see that disk cache is not enabled and the network speed instantly reaches 30-60mb / s.

Whether the concurrent download queue and the number of concurrent downloads can be manually set;

Whether disk cache can be provided;

At present, I feel that there are still basic performance problems with this library.

Expected behavior

Reproduction steps

Configuration

Version: 3.1.0

Platform:

  • [ ] :iphone: Windows

baneyue avatar Oct 16 '21 07:10 baneyue

What do you mean with disk cache is not enabled? Last time I tested on Windows disk cache was working perfectly fine. I you think this package has basic performance problems you are free to use a different package or make your own.

renefloor avatar Oct 19 '21 08:10 renefloor

when Listview loads thousands of item pictures, and the memory soars. It is found that the network bandwidth reaches 30MB / s, which eventually leads to the software being killed by anti-virus software.

This framework recommends performance testing

baneyue avatar Oct 22 '21 10:10 baneyue

The cache manager already includes queueing for the download, so not to many images are downloaded at the same time. Would you recommend limiting the maximum download speed? I wouldn't know why we shouldn't download as soon as possible. As an app developer you are also responsible yourself for not showing/downloading thousands of (huge) pictures at the same time. If you really want to show thousands of pictures you should download very small versions of them. If you have a very big list you should use ListView.builder so only images are downloaded which are being shown.

renefloor avatar Oct 27 '21 06:10 renefloor

We have used listview.builder. When we find that the pictures are not visible, we will still download them. This problem will occur when we use the scroll bar to scroll quickly. Network bandwidth and CPU will soar at the same time

baneyue avatar Oct 29 '21 05:10 baneyue

Is there any progress on this issue

It's really a big problem

baneyue avatar Nov 09 '21 06:11 baneyue

When you quickly drag the scroll bar, the network speed will soon reach more than 20m / s, and then it will be killed as an exception by the anti-virus software. I mean, the number of pictures loaded in parallel is too large, and the control of rolling out of the screen has not been cancelled.

企业微信截图_16364515438502 @renefloor

baneyue avatar Nov 09 '21 09:11 baneyue

for now lowering the value of memCacheHeight helped me, but it's a temporary fix !

anirudhsharma392 avatar Nov 09 '21 18:11 anirudhsharma392

@baneyue is this really different when you use NetworkImage instead of CachedNetworkImage?

renefloor avatar Nov 11 '21 16:11 renefloor

yes , The performance problem is the biggest problem of cachednetworkimage, and there is no good solution at present

baneyue avatar Nov 15 '21 05:11 baneyue

I am having the same problem. I am even getting out of memory exceptions.

Klabauterman avatar Jun 30 '22 23:06 Klabauterman