do you know whether there is a way to set a hard limit on the disk space reserved for caching thumbnails and full previews? It would be nice to avoid uncontrolled usage of disk space: it could be done in such a way that the oldest computed thumbnails and full previews get deleted to make room for newly used ones once the limit is reached.
memory in megabytes to use for thumbnail cache In order to speed up the display of film rolls, darktable stores image thumbnails in a cache on disk (primary cache) and loads it into memory at startup. This setting controls the size of the cache in megabytes. Needs a restart if changed (default 512MB).
As I read that part of the manual, the primary cache is stored on disk and in memory. So the limit should apply to both the disk and the memory version (or one would become larger than the other).
There are secondary caches, which can be enabled or disabled as required. For those, I think there’s no option to limit the size. But see the remark for the full preview cache:
“Several gigabytes” is less than most have as system memory. So if such an amount of diskspace is a problem, you can just disable the secondary caches.
The system you propose would require a certain amount of extra bookkeeping, especially if you want to delete the least recently used files (as opposed to least recently created, but that can give you unpleasant surprises when you review older images…). Extra bookkeeping would slow down the system in an unpredictable way.
I didn’t see any bookkeeping files in the darktable cache directory, so an alternative might be to start dt through a script which first cleans up the cache (easiest: remove files older than x days, harder: remove least recently used to get cache size below a specified limit).
Yes, I was talking about the secondary caches, stored on disk only. I can see your point about bookkeeping overheads, which may not be straightforward to implement. But, setting that aside for a moment, I don’t think the system would give you “unpleasant surprises”: if a thumbnail/full preview was not found in the cache at the moment of usage, it would be simply recreated on the fly (I think that Lightroom works in a similar way for full size previews).