Memory size is greater than image sizes? how to free memory on navigating back?
See original GitHub issueI am displaying 300+ items in a listview and each having image defined as below. Images are retrieved from aws s3 bucket. I profiled memory usage with xamarin profiler and I can see that the more I scroll in the list, memory usage increases which makes sense as each images are cached. But I am going above 300 mb cache. total size of all images physically are not more than 15 mb.
-
How can it be cached 20 times more than actual size? If I use loading.png for loadingplaceholder, is it also cached for 300 times for each item in the list?
-
When i navigate back from the list, my memory size is not reduced. this is probably expected as some people may want to keep them in memory. Is there an option free the memory in build? a parameter or something?
<ffimageloading:CachedImage RetryCount="1"
DownsampleToViewSize="true"
TransparencyEnabled = "false" CacheDuration = "30"
LoadingPlaceholder="loading_dark.png" ErrorPlaceholder="error.png"
Source="{Binding Image, Converter={StaticResource thumbnailConvertor}}"
Aspect="AspectFit" />
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to prevent excessive memory usage when resizing ...
I'm using a image resizing library for resizing images on a website. To better secure the image resizing process I used a fuzzer(afl...
Read more >How To Optimize Images for Web and Performance
The primary goal of formatting your images is to find the balance between the lowest file size and an acceptable quality. There is...
Read more >PVS Internals #2 – How to properly size your memory
In first part, I've prepared the theoretical ground for the discussion about proper sizing of the memory. You should already understand the ...
Read more >Memory management and patterns in ASP.NET Core
Learn how memory is managed in ASP.NET Core and how the garbage collector (GC) works.
Read more >Strategies for Efficient Use of Memory - MATLAB & Simulink
One simple way to increase the amount of memory you have available is to clear large arrays that you no longer use. Save...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As @molinch said:
downloaded file size != bitmap size in memory
1px = 4 Bytes (Android ARGB_8888) 1024px x 1024px = 4 Megabytes 2048px x 2048px = 16 Megabytes
Every PNG / JPG is decoded into a bitmap, there’s no other way. That’s why downscaling is so important.
@EmilAlipiev
You can control memory cache size by yourself 😃 Just use custom FFImageLoading config: