GNU bug report logs -
#33275
27.0.50; Image cache pruning
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Mon, 5 Nov 2018 14:09:02 UTC
Severity: normal
Tags: fixed
Found in version 27.0.50
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Mon, 05 Nov 2018 15:07:30 +0100
>
> So after trying various things, it turned out that you can kill Emacs by
> doing this:
>
> (dolist (file (directory-files "/directory/with/many/images" t "png$"))
> (image-size (create-image file) t))
>
> and this is because `image-size' puts the image into the image cache.
> Calling `clear-image-cache' releases the memory.
>
> I think putting it into the cache is the right thing to do, because if
> you're calling `image-size' on a file, then nine out of ten times you
> want to display it, and my use case here is atypical (batch-processing
> of a large number of huge images), but it's still not optimal that you
> can crash Emacs in this way.
Doesn't this mean that your system's VM is misconfigured? How is it
Emacs's fault that you've run a program that gobs so much memory as to
trigger the OS's OOM killer?
> So perhaps the cache should be pruned more aggressively according to
> some smart algorithm or other? Or, at the very least, an
> innocuous-looking function like `image-size' should note in the doc
> string should note what's going on and recommend calling `image-flush'
> afterwards if we don't want to cache the image?
I'm okay with saying something about this in the docs, but frankly,
you could do the same in any number of ways, like by visiting a file
whose size is larger than the VM you allow your system to use, right?
So there's a potential for causing such problems in many different
ways, and warning about that only in the doc string of image-size
seems insufficient, to say the least...
This bug report was last modified 5 years and 239 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.