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
Message #56 received at 33275 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> After thinking about this and looking at the code, I don't think I
> understand your proposal(s). Here are the issues that I saw with what
> I think you proposed:
>
> . The hash table used by the image cache is not a Lisp hash-table, so
> weakness doesn't apply. We cache pointers to C structs, so using a
> Lisp hash-tables would need "some work".
Yeah, it'd have to be rewritten substantially to use Lisp hash tables.
> . The code you show above is called from redisplay, so it will not be
> executed as long as a Lisp program (such as the one you show at the
> beginning of this discussion) runs, and you will still have the OOM
> killer get you before that code get a chance to clear the cache.
That's true, but calling the cache pruning function from the function
that enters images into the cache would be trivial, I think.
> . Running such code from GC could be tricky, because freeing images
> needs to remove references of those images from the glyph matrices,
> and that cannot be safely done from arbitrary places.
Ah, I see. Yes, that's a major complication...
> I think if we want to prevent the OOM killer from killing Emacs due to
> many cached images, we should inspect inside cache_image the current
> VM size of the process (like system_process_attributes does), compare
> it to the memory limits, and display a warning and/or signal an error
> when we get dangerously close to the limit.
I think that sounds like a good idea, yes. Having such a check is good
for Emacs sanity, but we should also have a way for programmers to avoid
ending up in that pathological situation to begin with.
So either a DONT-CACHE parameter to `image-size' or just a docstring
thing. :-)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
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.