> Please see also the recent discussion in > https://debbugs.gnu.org/38187#95 Thanks. Similar to that discussion, I tried to force clearing the image cache after killing each image buffer. #+begin_sec emacs-lisp (dolist (file (directory-files "~/Tosort/pictures&photos/" 'full ".*jpg")) (find-file file) (mapc #'kill-buffer (seq-filter (apply-partially #'string-match ".+.jpg$") (mapcar #'buffer-name (buffer-list)))) (garbage-collect) (clear-image-cache t)) #+end_src The resulting memory consumption graph is attached. The memory increase almost disappeared (remaining heap size becomes ~40Mb in comparison ~400Mb in the version with just garbage collect). Just calling (clear-image-cache) after cycling over opening/killing the image buffers still results in ~400Mb (it has no effect, basically). The above result is confusing since the all the code I tried to run so far had (setq image-cache-eviction-delay 5). Since, cycling over all the images usually took >1min, cache clearing supposed to happen at least several times during opening/killing the image buffers. To understand further, I tried to disable automatic cache clearing completely (setq image-cache-eviction-delay 5000). The resulting memory consumption is ~400Mb, but a few tens of Mb higher in comparison with (setq image-cache-eviction-delay 5). It appears to me that clearing image cache has some problem when there is a relatively large number of images in the cache already. Regards, Ihor