all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Image cache
@ 2006-02-07 10:52 Juri Linkov
  2006-02-07 17:21 ` Chong Yidong
  2006-02-07 20:59 ` Stefan Monnier
  0 siblings, 2 replies; 23+ messages in thread
From: Juri Linkov @ 2006-02-07 10:52 UTC (permalink / raw)


After generating different images in the same file and visiting them after
every change in Emacs, I noticed that the displayed image doesn't
get updated.  Later I found the variable image-cache-eviction-delay and
changed its value to a small delay (1 sec), but it didn't have any effect
contrary to its documentation: the changed image was not updated in
the cache.  It seems this behavior is caused by the constant value
#define CLEAR_IMAGE_CACHE_COUNT 101 that checks the value of
image-cache-eviction-delay only on 101-st redisplay.  Surely, I can use
(add-hook 'post-command-hook 'clear-image-cache), but this is not
a general solution.

OTOH, I don't see why I should change the value of image-cache-eviction-delay,
if it is Emacs' job to update the cache when the image data changes.
So I found that updating the image cache after visiting an new image
was correct before the 2006-01-30 change in image-mode.el:

	* image-mode.el (image-toggle-display): Use file name if possible,
	instead of unnecessarily allocating a (possibly huge) lisp string.

But I don't blame this change.  It is a good optimization, but it
revealed a problem in cache processing code.  This code doesn't update
the cache for the file name when the file contents changes.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: Memory leak in keyboard variables?
@ 2008-12-15  1:26 Kenichi Handa
  2008-12-15  3:16 ` Chong Yidong
  0 siblings, 1 reply; 23+ messages in thread
From: Kenichi Handa @ 2008-12-15  1:26 UTC (permalink / raw)
  To: emacs-devel

> One thing I noticed is the xftfont_open is run whenever we
> call "emacsclient -c", but xftfont_close is never called.
> It appears that font_open_entity is called to allocate a
> font object, it is in general not recorded anywhere.

No.  A font object is recorded in FONT_OBJLIST_INDEX of a
font-entity.

> Could this be part of the problem?

The strategy is to record all font-objects in font-entities, and
record all font-entities in a cache of each font-backend.  The caches
are freed when `delete-frame' calls font_update_drivers with
new_drivers as nil through this calling sequence.

font_update_drivers -> font_finish_cache -> font_clear_cache

At that time all font-entities and font-obects are freed.

If there's a memory leak for font objectes, it means that there is a
bug at some code implementing the above strategy.

I don't have a time to tackle this problem at the moment,
but I'll take care of it as soon as possible.

---
Kenichi Handa
handa@m17n.org




^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-12-16  7:02 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07 10:52 Image cache Juri Linkov
2006-02-07 17:21 ` Chong Yidong
2006-02-08  7:22   ` Mathias Dahl
2006-02-08  9:23   ` Juri Linkov
2006-02-14  1:48     ` Juri Linkov
2006-02-07 20:59 ` Stefan Monnier
2006-02-09 17:48   ` Richard M. Stallman
2006-02-09 19:18     ` Juri Linkov
2006-02-09 22:12       ` Chong Yidong
2006-02-09 22:51       ` Mathias Dahl
2006-02-10  0:10       ` Miles Bader
2006-02-10 23:02       ` Richard M. Stallman
2006-02-10 23:21         ` Miles Bader
2006-02-11  1:18           ` Juri Linkov
2006-02-11  2:14           ` Chong Yidong
2006-02-11 21:59             ` Miles Bader
2006-02-12  0:47           ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-12-15  1:26 Memory leak in keyboard variables? Kenichi Handa
2008-12-15  3:16 ` Chong Yidong
2008-12-15  4:06   ` image cache (was: Memory leak in keyboard variables?) Stefan Monnier
2008-12-15  4:12     ` Eli Zaretskii
2008-12-15 15:19       ` image cache Stefan Monnier
2008-12-15 16:08         ` Chong Yidong
2008-12-15 20:09           ` Stefan Monnier
2008-12-16  1:41           ` Miles Bader
2008-12-16  4:56             ` Chetan Pandya
2008-12-16  7:02               ` Chetan Pandya

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.