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

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

Thierry Volpiatto <[email-masked]> writes:

>> AFAIU, calling `clear-image-cache' should also the free memory unless we
>> have a memory leak.  You could also call this function from your code.
>> Does calling this function free the memory for you?
>
> Yes it does 🙂.  I didn't know this function (BTW what about renaming to
> `image-clear-cache`), works great with my code, perhaps you can do the
> same in dired (we use more or less similar code).

Great!  For now, this is just a temporary workaround for high memory
usage, so I'd personally be more inclined to work on the underlying
issue than adding it to Image-Dired.

I also believe that you will want to revisit the decision to use it once
this bug is fixed: it is a bit of a sledgehammer and can lead to
undesirable results (slowdowns).

As for renaming it to `image-clear-cache', I think it would be good but
let's see if anyone else thinks otherwise.