Subject: bug#51763: 27.2; Displaying many images take all memory

From: Stefan Kangas <[email-masked]>
Date: Thu, 11 Nov 2021 09:33:39 -0800

Lars Ingebrigtsen <[email-masked]> writes:

> We've previously discussed adding a parameter to image-size to disable
> this caching.  Perhaps we should just do that?

I didn't follow those discussions, but that's what I think we should do
as well.

Should we perhaps also add a max cache size in addition to the
`image-cache-eviction-delay'?  I find it easy to get memory usage up to
several GiB when viewing large images, and all that happens in less than
five minutes.  (That would be a separate feature request though, as this
bug is about the memory usage regression introduced in Image-Dired.)

Relatedly, image-mode could be smarter, and evict images manually from
the cache.  Let's say that when flipping through images in a directory,
we only keep the previous N images (where N is, like, 5 or something).