Page 1 of 1

Ability to limit the thumbnail cache.

Posted: 05 May 2008 14:45
by TheQwerty
There needs to be a way to limit the size of the thumbnail cache automatically.

I suggest one of the following user options:
1) Ability to define the maximum size of the thumbnails folder.
2) Ability to define the maximum number of thumbnails to cache.

Once the maximum is reached the least recently accessed items should be replaced by the new ones.

Posted: 21 May 2008 13:23
by TheQwerty
Bumping this, since there was no response.
This is especially essential when running XY portably.

Posted: 21 May 2008 13:43
by admin
The thumbs cache has 2 files for each folder with thumbnails. One file contains the the number of images, their names and dimensions and some other info; the other contains the raw image data.

Nowhere else is the total number of thumbs stored. So I would have to caculate it each time the cache is written. Not good.

Why exactly are you suggesting to add a limit?

Posted: 21 May 2008 14:00
by TheQwerty
It just seems very sloppy for it to eat up more and more space over time.
When run portably there's good reason to keep programs in check regarding their disk space.

Right now my Thumbnail cache is nearing 100 MB, and that's with a copy that isn't doing a lot of managing of images. My home copy is probably taking up a lot more space.


As an alternative, perhaps the following would work:
Create a new function/scripting command/menu item:
"Clean Thumbnail Cache" which would calculate the folder size, and if greater than a user setting, remove the oldest/LRU items until it's under the max size.

Then have two user options:
"Maximum Thumbnail Cache Size"
"Clean Thumbnail Cache on Exit" - which would execute the function when closing XY.

Posted: 21 May 2008 14:09
by admin
TheQwerty wrote:It just seems very sloppy for it to eat up more and more space over time.
When run portably there's good reason to keep programs in check regarding their disk space.

Right now my Thumbnail cache is nearing 100 MB, and that's with a copy that isn't doing a lot of managing of images. My home copy is probably taking up a lot more space.


As an alternative, perhaps the following would work:
Create a new function/scripting command/menu item:
"Clean Thumbnail Cache" which would calculate the folder size, and if greater than a user setting, remove the oldest/LRU items until it's under the max size.

Then have two user options:
"Maximum Thumbnail Cache Size"
"Clean Thumbnail Cache on Exit" - which would execute the function when closing XY.
I somehow dislike this kind of smartness. Why don't you just go there and delete the LRU items? Takes 10 seconds maybe...

Posted: 21 May 2008 15:08
by TheQwerty
admin wrote:I somehow dislike this kind of smartness. Why don't you just go there and delete the LRU items? Takes 10 seconds maybe...
Because I shouldn't have to babysit XY?

This kind of smartness is merely XY being responsible and recognizing the fact that while there may be a lot of resources available it's not XY's right to (attempt to) consume them all.

Posted: 21 May 2008 15:33
by admin
TheQwerty wrote:
admin wrote:I somehow dislike this kind of smartness. Why don't you just go there and delete the LRU items? Takes 10 seconds maybe...
Because I shouldn't have to babysit XY?

This kind of smartness is merely XY being responsible and recognizing the fact that while there may be a lot of resources available it's not XY's right to (attempt to) consume them all.
Okay. I could issue a warning (on closing the app?) when the cache folder is larger then a certain size. Would that help?

Posted: 21 May 2008 15:46
by TheQwerty
admin wrote:Okay. I could issue a warning (on closing the app?) when the cache folder is larger then a certain size. Would that help?
Eh...

For now, leave it as is, but make a note at the bottom of your list to consider a better caching system (that would allow XY to be more responsible), and hopefully some other users can comment on this. (And really you might want to make a note with the search result caching item(s) as well.)


It's not that this is an actual issue at the moment, but I feel the current method comes off as sloppy and reflects poorly on you for just assuming it's okay for the cache to grow without limits. Especially when using XY portably is such a beneficial and marketable feature.

Posted: 21 May 2008 21:53
by admin
TheQwerty wrote:
admin wrote:Okay. I could issue a warning (on closing the app?) when the cache folder is larger then a certain size. Would that help?
Eh...

For now, leave it as is, but make a note at the bottom of your list to consider a better caching system (that would allow XY to be more responsible), and hopefully some other users can comment on this. (And really you might want to make a note with the search result caching item(s) as well.)


It's not that this is an actual issue at the moment, but I feel the current method comes off as sloppy and reflects poorly on you for just assuming it's okay for the cache to grow without limits. Especially when using XY portably is such a beneficial and marketable feature.
Okay, as it is currently, you should not use caching when you don't want to leave traces on the host computer.

As a first little improvement I just made the thumbs cache folder definition fully portable. This allows you to keep the traces relative to XYplorer.exe (drive / folder).

The rest: at the bottom of my list.

Posted: 22 May 2008 03:02
by TheQwerty
Just to add as a point of reference... my thumbnail folder here at home weighs in at 1.25 GB. That's no typo either it's 1,348,927,488 bytes.