<div dir="ltr">Hi Robby,<br><div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-22 2:05 GMT+01:00 Robby Stephenson <span dir="ltr"><<a href="mailto:robby@periapsis.org" target="_blank">robby@periapsis.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Valerio,<span class=""><br>
<br>
On 03/21/2016 05:54 AM, Valerio Ricci wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I am running tellico 2.3.9 under kubuntu 15.10 and I noticed a memory usage issue when browsing my book collection.<br>
<br>
I have a book collection of ca. 650 entries and about 220 of them have cover images.<br>
<br>
The xml file is about 2MB and all the images, stored in a separate folder are about 130MB in total.<br>
<br>
I made the collection some time ago and I started adding the cover images recently.<br>
To see how many of them where missing I made a filter that follows the following criteria: cover field contains "."<br>
<br>
As expected I end up with my 220 entries listed.<br>
<br>
The problem is that when I click on the newly created filter the memory usage jumps from 44.2 MB to 2.8 GB.<br>
<br>
I suspect this is because the images are loaded into memory (and maybe they are also decompressed from their original .jpg format).<br>
</blockquote>
<br></span>
They are loaded and scaled, but they shouldn't be held in memory. Or at least, that's not my intent. There's an internal cache, too, that should help manage the memory usage.<span class=""><br></span></blockquote><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
While this can be an expected behavior it can be a problem when you have to manage a large collection with many images.<br>
I don't have all the images to populate all my 650 entries but making a simple proportion I can infer that it will take over 8 GB of ram.<br>
</blockquote>
<br></span>
My book collection is a bit smaller, 46MB or so of jpeg images. When I create a filter as you describe, my memory usage does jump up by about 200 MB, but not into GB as you are experiencing. I'll poke at it some.<br></blockquote><div><br></div><div>I want to point out that the memory is filled when I click on the filter and not before I do. This lets me believe it could be an issue related to how the pictures are loaded in memory to be displayed on screen. But obviously it is just an hypothesis.<br></div><div> </div><div>For the sake of completeness I can also say that all the images are relatively big, having a resolution around 1500x2500px and are compressed jpeg files about 400KB to 1MB in size.<br><br></div><div>Again, I'm not sure about how tellico (or the C++ back-end or whatever) handles compressed images but it seems like the memory consumption increases exponentially.<br><br></div><div>I just made some testing:<br><br></div><div>Collection with 1 entry, no images -> memory consumption 35 MB<br>Collection with 1 entry, 1 image (11487x2649px, 3.5 MB jpeg      -> memory consumption 72.3 MB<br>Collection with 1 entry, 1 image (7024x4687px, 4.3 MB jpeg    -> memory consumption 79.6 MB<br>Collection with 2 entries, 2 images (the above 2 together)   -> memory consumption 351.7 MB<br><br></div><div>The two images are respectively at <a href="http://i.imgur.com/hYdBawf.jpg">http://i.imgur.com/hYdBawf.jpg</a> and <a href="https://upload.wikimedia.org/wikipedia/commons/4/47/Canonization_2014-_The_Canonization_of_Saint_John_XXIII_and_Saint_John_Paul_II_%2814036894824%29.jpg">https://upload.wikimedia.org/wikipedia/commons/4/47/Canonization_2014-_The_Canonization_of_Saint_John_XXIII_and_Saint_John_Paul_II_%2814036894824%29.jpg</a><br><br></div><div>The second image is 24MB, but I noticed that when tellico creates the copy of the file in the collection folder the size is reduced to 4.3MB. I suppose this is due to a different compression ratio in jpeg. I've tried to add the original file and the "resized" file just to notice that memory consumption is not changing.<br></div><div>  <br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Just to confirm your setting, your Image Storage is set to "Store images in directory relative to data file" ?<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>Yes it is. Same for the previous testing.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
<br>
Robby<br></font></span></blockquote><div><br></div><div>Hope this helps <br></div></div><br></div><div class="gmail_extra">Valerio<br></div></div></div>