Page 1 of 1

Avoid emptying preloading cache in some situations.

PostPosted: Fri Jan 20, 2012 2:06 am
by mkk
I've noticed a behavior that seems to be that the preload cache(great function btw) seems to empty itself whenever the viewer reaches the first or the last picture in a folder. The memory usage of the process and momentary sluggishness (or less awesome speediness if you will) suggests that something like that is happening, and previously done preloading work has to start anew. I've noticed this behavior since I started trying the program out a number of months ago so it's nothing new. It's also not a problem but I think an unwanted thing.

Just maybe that slider "Less - - - More" could incorporate some numericals as well, or a rough indication of how much memory can be used at various levels. Understandably tricky since it varies from system to system, but it would be informative. :)

Re: Avoid emptying preloading cache in some situations.

PostPosted: Fri Jan 20, 2012 6:33 am
by Axel
I'll have a look at this. Normally the program does not discard preloaded images until it needs the space. There are a couple of situations where the preload cache is emptied, for example when starting the File Utilities plugin (Ctrl+F) or the Web Publishing subsystem (Ctrl+P) as these can perform some image processing (like when converting to JPEG) and needs RAM, or when the "memory pressure" on the system gets high (if you start another memory-hungry application).

There may be situations where you are just on a threshold and some memory is freed when it perhaps could have been held for a little longer. This may occur more often if the image's sizes are very irregular, like you are browsing a folder containing a mix of image dimensions from small to large in random order, making it difficult to predict in advance how many of the next few images will fit in what remains of free memory. The system is adaptive and should work well when the image dimensions are consistent (like when browsing a bunch of 16MP images from a given camera). The optional automatic downscaling function can help even out the outliers.

The slider is just a hint. Normally its default position at about 1/4-1/3 of the range should be fine for most uses. The program uses several factors to decide how many images to preload, and the slider is just a hint telling it how aggressive the algorithm should be. It always starts conservatively and tries to load more images as you scroll through them.

If you know you only browse relatively small images, you can increase the preload hint a little and the program will more rapidly increase the preload cache size. When browsing mostly large images, the preloading must be reduced, i.e. the slider should be returned to the 1/4 position or less. Anything above about half is pretty extreme, this part of the range exists to accomodate small images (such as HD video frames which are less then 2MP each and which, with enough RAM and a beefy computer and disks, can be played at 25 images/sec without problems with a long-enough prefetch queue).

12 to 16 MP DSLR image are considered large and the slider's position should probably lie in the left half of the range.

The settings on the Resources Usage option page are pretty advanced and are meant to offer a way to tailor some aspects of the image loading to special situations, like the presence of an exceptionally fast disk subsystem, lots (or little) system memory, mostly small (or mostly very large) images etc. For most uses the defaults works just fine.

Re: Avoid emptying preloading cache in some situations.

PostPosted: Sat Jun 16, 2012 12:40 am
by mkk
I noticed that this only occurrs if the setting "Rewind to the beginning..." under Misc is unchecked.