From unknown Mon Aug 18 11:10:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#6230 <6230@debbugs.gnu.org> To: bug#6230 <6230@debbugs.gnu.org> Subject: Status: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used Reply-To: bug#6230 <6230@debbugs.gnu.org> Date: Mon, 18 Aug 2025 18:10:02 +0000 retitle 6230 23.2; Pixmaps kept in X11 after (svg?) images no longer are us= ed reassign 6230 emacs submitter 6230 Anders Waldenborg severity 6230 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 20 11:51:01 2010 Received: (at submit) by debbugs.gnu.org; 20 May 2010 15:51:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF81T-0006E5-WB for submit@debbugs.gnu.org; Thu, 20 May 2010 11:51:01 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF7rm-00068L-2J for submit@debbugs.gnu.org; Thu, 20 May 2010 11:40:59 -0400 Received: from lists.gnu.org ([199.232.76.165]:39941) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OF7rh-0007eL-BL for submit@debbugs.gnu.org; Thu, 20 May 2010 11:40:53 -0400 Received: from [140.186.70.92] (port=54053 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF7rb-0002ht-H1 for bug-gnu-emacs@gnu.org; Thu, 20 May 2010 11:40:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF7rU-0007NF-VH for bug-gnu-emacs@gnu.org; Thu, 20 May 2010 11:40:47 -0400 Received: from phlox.netintact.se ([217.73.97.18]:54131) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF7rT-0007Ll-Sq for bug-gnu-emacs@gnu.org; Thu, 20 May 2010 11:40:40 -0400 Received: from hoth.proceranetworks.com (hoth.proceranetworks.com [194.153.91.41]) by phlox.netintact.se (Postfix) with ESMTP id B72D02800B for ; Thu, 20 May 2010 17:40:36 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id 8A32D45F0002 for ; Thu, 20 May 2010 17:40:36 +0200 (CEST) Received: from hoth.proceranetworks.com ([127.0.0.1]) by localhost (hoth.proceranetworks.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4dE+3x+ah39R for ; Thu, 20 May 2010 17:40:31 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id 99BD645F0001 for ; Thu, 20 May 2010 17:40:31 +0200 (CEST) Message-ID: <4BF557EE.4050400@0x63.nu> Date: Thu, 20 May 2010 17:40:30 +0200 From: Anders Waldenborg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 20 May 2010 11:50:59 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) By running the command defined by the following: (require 'cl) (defun aw-replace-buffer-contents-with-svg-images () (interactive) (erase-buffer) (dotimes (N 200) (insert-image (create-image (format "" (random 255)(random 255)(random 255)) 'svg t)))) the current buffer will be replaced with 200 images. Running xrestop it can easily be seen that 200 pixmaps are added to the X11 server every time the command is run. One would expect that the pixmaps were removed from X11 when they don't exist in any buffer any longer (which is why recipe uses erase-buffer so it can be run multiple times, increasing number of pixmaps every time - not the behaviour I expect). The pixmaps doesn't even go away when the buffer is killed. Don't know if this applies to all image types or only svg. In GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-05-16 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10707000 configured using `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-M-x C-M-x M-x r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set cl aw-replace-buffer-contents-with-svg-images Making completion list... Load-path shadows: /usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs/23.2/site-lisp/semi/pgg-pgp5 hides /usr/share/emacs/23.2/lisp/pgg-pgp5 /usr/share/emacs/23.2/site-lisp/semi/pgg-gpg hides /usr/share/emacs/23.2/lisp/pgg-gpg /usr/share/emacs/23.2/site-lisp/semi/pgg-parse hides /usr/share/emacs/23.2/lisp/pgg-parse /usr/share/emacs/23.2/site-lisp/flim/sha1 hides /usr/share/emacs/23.2/lisp/sha1 /usr/share/emacs/23.2/site-lisp/flim/md4 hides /usr/share/emacs/23.2/lisp/md4 /usr/share/emacs/23.2/site-lisp/flim/hex-util hides /usr/share/emacs/23.2/lisp/hex-util /usr/share/emacs/23.2/site-lisp/semi/pgg-def hides /usr/share/emacs/23.2/lisp/pgg-def /usr/share/emacs/23.2/site-lisp/semi/pgg-pgp hides /usr/share/emacs/23.2/lisp/pgg-pgp /usr/share/emacs/23.2/site-lisp/semi/pgg hides /usr/share/emacs/23.2/lisp/pgg /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/23.2/lisp/textmodes/rst /usr/share/emacs/23.2/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell /usr/share/emacs/23.2/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell /usr/share/emacs/23.2/site-lisp/flim/sasl hides /usr/share/emacs/23.2/lisp/net/sasl /usr/share/emacs/23.2/site-lisp/flim/hmac-md5 hides /usr/share/emacs/23.2/lisp/net/hmac-md5 /usr/share/emacs/23.2/site-lisp/flim/sasl-cram hides /usr/share/emacs/23.2/lisp/net/sasl-cram /usr/share/emacs/23.2/site-lisp/flim/hmac-def hides /usr/share/emacs/23.2/lisp/net/hmac-def /usr/share/emacs/23.2/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/23.2/lisp/net/sasl-ntlm /usr/share/emacs/23.2/site-lisp/flim/sasl-digest hides /usr/share/emacs/23.2/lisp/net/sasl-digest /usr/share/emacs/23.2/site-lisp/flim/ntlm hides /usr/share/emacs/23.2/lisp/net/ntlm /usr/share/emacs/23.2/site-lisp/wl/rfc2368 hides /usr/share/emacs/23.2/lisp/mail/rfc2368 Features: (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 sha1-el hex-util hashcash mail-utils emacsbug help-mode easymenu view cl cl-19 tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Thu May 20 13:16:35 2010 Received: (at 6230) by debbugs.gnu.org; 20 May 2010 17:16:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF9MJ-0006zD-1J for submit@debbugs.gnu.org; Thu, 20 May 2010 13:16:35 -0400 Received: from pantheon-po30.its.yale.edu ([130.132.50.4]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF9MH-0006z8-UH for 6230@debbugs.gnu.org; Thu, 20 May 2010 13:16:34 -0400 Received: from furry (dhcp128036014213.central.yale.edu [128.36.14.213]) (authenticated bits=0) by pantheon-po30.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o4KHGRox019859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 20 May 2010 13:16:27 -0400 Received: by furry (Postfix, from userid 1000) id 88479C057; Thu, 20 May 2010 13:16:27 -0400 (EDT) From: Chong Yidong To: Anders Waldenborg Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used References: <4BF557EE.4050400@0x63.nu> Date: Thu, 20 May 2010 13:16:27 -0400 In-Reply-To: <4BF557EE.4050400@0x63.nu> (Anders Waldenborg's message of "Thu, 20 May 2010 17:40:30 +0200") Message-ID: <87r5l6v6hg.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6230 Cc: 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Anders Waldenborg writes: > By running the command defined by the following: > > (require 'cl) > (defun aw-replace-buffer-contents-with-svg-images () > (interactive) > (erase-buffer) > (dotimes (N 200) > (insert-image (create-image (format " height=\"50\"> fill=\"#%02x%02x%02x\"/>" (random 255)(random 255)(random 255)) > svg t)))) > > the current buffer will be replaced with 200 images. Running xrestop it > can easily be seen that 200 pixmaps are added to the X11 server every > time the command is run. > > One would expect that the pixmaps were removed from X11 when they don't > exist in any buffer any longer (which is why recipe uses erase-buffer so > it can be run multiple times, increasing number of pixmaps every time - > not the behaviour I expect). > > The pixmaps doesn't even go away when the buffer is killed. You can run (clear-image-cache) to eliminate the image data. Emacs also does this automatically, every hundred redisplays. From debbugs-submit-bounces@debbugs.gnu.org Thu May 20 16:07:58 2010 Received: (at 6230) by debbugs.gnu.org; 20 May 2010 20:07:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFC2A-0000Pp-Ay for submit@debbugs.gnu.org; Thu, 20 May 2010 16:07:58 -0400 Received: from phlox.netintact.se ([217.73.97.18]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFC27-0000Pj-OZ for 6230@debbugs.gnu.org; Thu, 20 May 2010 16:07:56 -0400 Received: from hoth.proceranetworks.com (hoth.proceranetworks.com [194.153.91.41]) by phlox.netintact.se (Postfix) with ESMTP id 754F92800C; Thu, 20 May 2010 22:07:50 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id 5488245F0003; Thu, 20 May 2010 22:07:50 +0200 (CEST) Received: from hoth.proceranetworks.com ([127.0.0.1]) by localhost (hoth.proceranetworks.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SGjq4pdCxU57; Thu, 20 May 2010 22:07:45 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id 556C845F0001; Thu, 20 May 2010 22:07:45 +0200 (CEST) Message-ID: <4BF59689.7020003@0x63.nu> Date: Thu, 20 May 2010 22:07:37 +0200 From: Anders Waldenborg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: Chong Yidong Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used References: <4BF557EE.4050400@0x63.nu> <87r5l6v6hg.fsf@stupidchicken.com> In-Reply-To: <87r5l6v6hg.fsf@stupidchicken.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 6230 Cc: 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) On 05/20/2010 07:16 PM, Chong Yidong wrote: > You can run (clear-image-cache) to eliminate the image data. Emacs also > does this automatically, every hundred redisplays. > Thanks, I can confirm that running (clear-image-cache) removes them from the X server. However I can't see that it is done every 100 redisplays. If it were I would expect the code below to never create more than 100 (+ the ones that were there before it started) pixmaps in X11. Letting it run while writing this mail it now has reached above 3000 pixmaps according to xrestop. (defun aw-svg-image-test-update (buf) (interactive) (with-current-buffer buf (erase-buffer) (insert-image (create-image (format "" (random 255)(random 255)(random 255)) 'svg t)))) (defun aw-svg-image-test-kill-buffer-hook () (cancel-timer aw-svg-image-test-timer)) (defun aw-svg-image-test () (interactive) (with-current-buffer (generate-new-buffer "*aw-svg-image-test*") (display-buffer (current-buffer)) (make-local-variable 'aw-svg-image-test-timer) (add-hook 'kill-buffer-hook 'aw-svg-image-test-kill-buffer-hook nil t) (setq aw-svg-image-test-timer (run-at-time nil 0.2 'aw-svg-image-test-update (current-buffer))))) anders From debbugs-submit-bounces@debbugs.gnu.org Thu May 20 16:32:26 2010 Received: (at 6230) by debbugs.gnu.org; 20 May 2010 20:32:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFCPp-0000am-Mo for submit@debbugs.gnu.org; Thu, 20 May 2010 16:32:26 -0400 Received: from pantheon-po31.its.yale.edu ([130.132.50.82]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFCPo-0000ag-8W for 6230@debbugs.gnu.org; Thu, 20 May 2010 16:32:24 -0400 Received: from furry (dhcp128036014213.central.yale.edu [128.36.14.213]) (authenticated bits=0) by pantheon-po31.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o4KKWIKX020257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 20 May 2010 16:32:18 -0400 Received: by furry (Postfix, from userid 1000) id 2A11B16D427; Thu, 20 May 2010 16:32:18 -0400 (EDT) From: Chong Yidong To: Anders Waldenborg Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used References: <4BF557EE.4050400@0x63.nu> <87r5l6v6hg.fsf@stupidchicken.com> <4BF59689.7020003@0x63.nu> Date: Thu, 20 May 2010 16:32:18 -0400 In-Reply-To: <4BF59689.7020003@0x63.nu> (Anders Waldenborg's message of "Thu, 20 May 2010 22:07:37 +0200") Message-ID: <87k4qyuxf1.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6230 Cc: 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Anders Waldenborg writes: > However I can't see that it is done every 100 redisplays. If it were I > would expect the code below to never create more than 100 (+ the ones > that were there before it started) pixmaps in X11. Letting it run > while writing this mail it now has reached above 3000 pixmaps > according to xrestop. Oh, yes, I forgot. There is image-cache-eviction-delay as well. If you set this to a sufficiently small number, the test frees the pixmaps as required. Is there a specific reason you are interested in this problem? It's possible that we need to improve the conditions under which the image cache is freed, but it's hard to tell unless we have a use-case in mind. (Obviously, the current system assumes that the rate at which images are created is much lower than the "usual editing speed".) From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 02:38:13 2010 Received: (at 6230) by debbugs.gnu.org; 21 May 2010 06:38:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFLs4-0005O9-Cf for submit@debbugs.gnu.org; Fri, 21 May 2010 02:38:13 -0400 Received: from phlox.netintact.se ([217.73.97.18]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFLs0-0005O3-S9 for 6230@debbugs.gnu.org; Fri, 21 May 2010 02:38:10 -0400 Received: from hoth.proceranetworks.com (hoth.proceranetworks.com [194.153.91.41]) by phlox.netintact.se (Postfix) with ESMTP id 00A063E8001; Fri, 21 May 2010 08:38:05 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id D965C45F0002; Fri, 21 May 2010 08:38:04 +0200 (CEST) Received: from hoth.proceranetworks.com ([127.0.0.1]) by localhost (hoth.proceranetworks.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ArTxVRqgWe17; Fri, 21 May 2010 08:37:59 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id A87B545F0001; Fri, 21 May 2010 08:37:59 +0200 (CEST) Message-ID: <4BF62A46.10200@0x63.nu> Date: Fri, 21 May 2010 08:37:58 +0200 From: Anders Waldenborg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: Chong Yidong Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used References: <4BF557EE.4050400@0x63.nu> <87r5l6v6hg.fsf@stupidchicken.com> <4BF59689.7020003@0x63.nu> <87k4qyuxf1.fsf@stupidchicken.com> In-Reply-To: <87k4qyuxf1.fsf@stupidchicken.com> Content-Type: multipart/mixed; boundary="------------090403080700030203000601" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 6230 Cc: 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) This is a multi-part message in MIME format. --------------090403080700030203000601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/20/2010 10:32 PM, Chong Yidong wrote: > Oh, yes, I forgot. There is image-cache-eviction-delay as well. If you > set this to a sufficiently small number, the test frees the pixmaps as > required. Yes, that works, thanks. > Is there a specific reason you are interested in this problem? It's > possible that we need to improve the conditions under which the image > cache is freed, but it's hard to tell unless we have a use-case in mind. > (Obviously, the current system assumes that the rate at which images are > created is much lower than the "usual editing speed".) Well, I'm toying with a little vector graphics API built on top of emacs' svg support. And my first real example is a clock. By leaving it running for a few minutes easily makes my X server go out of memory. You can find the library (vrend.el) and the example implementing a clock (vrend-example-clock.el) attached. Not sure this clock is a real use-case. But I have a few other ideas in mind on how to use it, which all have substantially lower requirements on refresh rate, but probably large enough to create lots of pixmaps in 30 minutes (which seems to be default value for image-cache-eviction-delay) anders --------------090403080700030203000601 Content-Type: text/plain; name="vrend.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vrend.el" ;;; Beta quality code - use at own risk ;;; Copyright (C) 2010 Anders Waldenborg ;;; I'll add a GPL header or something like that here later... ; We handle the tranformation matrix (but let svg do the actual projection). ; So we need some stuff to handle matrices... (defconst vrend-2pi (* 8.0 (atan 1.0))) (defun vrend--mtx-col (mtx col) "Get column col in matrix mtx" (mapcar '(lambda (v) (aref v col)) mtx)) (defun vrend--mtx-row (mtx row) "Get row row in matrix mtx" (mapcar 'identity (aref mtx row))) (defun vrend--mtx-ref (i j) (aref (aref vrend--curr-mtx i) j)) (defun vrend--dotprod (l r) "dot product of l and r" (if (or l r) (+ (* (car l) (car r)) (vrend--dotprod (cdr l) (cdr r))) 0)) (defun vrend--mtx-mul3x3 (l r) `[[,(vrend--dotprod (vrend--mtx-row l 0) (vrend--mtx-col r 0)) ,(vrend--dotprod (vrend--mtx-row l 0) (vrend--mtx-col r 1)) ,(vrend--dotprod (vrend--mtx-row l 0) (vrend--mtx-col r 2))] [,(vrend--dotprod (vrend--mtx-row l 1) (vrend--mtx-col r 0)) ,(vrend--dotprod (vrend--mtx-row l 1) (vrend--mtx-col r 1)) ,(vrend--dotprod (vrend--mtx-row l 1) (vrend--mtx-col r 2))] [,(vrend--dotprod (vrend--mtx-row l 2) (vrend--mtx-col r 0)) ,(vrend--dotprod (vrend--mtx-row l 2) (vrend--mtx-col r 1)) ,(vrend--dotprod (vrend--mtx-row l 2) (vrend--mtx-col r 2))]]) (defun vrend--mtx-translate (dx dy) "translationmatrix for dx dy" `[[1.0 0.0 ,dx] [0.0 1.0 ,dy] [0.0 0.0 1.0]]) (defun vrend--mtx-rotate (rot) "" `[[,(cos rot) ,(- (sin rot)) 0.0] [,(sin rot) ,(cos rot) 0.0] [ 0.0 0.0 1.0]]) (defun vrend--mtx-scale (sx sy) "" `[[,sx 0.0 0.0] [0.0 ,sy 0.0] [0.0 0.0 1.0]]) (defun vrend--mtx-ident () "" [[1.0 0.0 0.0] [0.0 1.0 0.0] [0.0 0.0 1.0]]) (defun vrend-path-start (x y) (setq vrend--curr-path nil) (vrend-path-moveto x y)) (defun vrend-path-moveto (x y) (add-to-list 'vrend--curr-path (list ?M x y))) (defun vrend-path-lineto (x y) (add-to-list 'vrend--curr-path (list ?L x y))) (defun vrend-path-close () (add-to-list 'vrend--curr-path (list ?Z))) (defun vrend-rotate (deg) (setq vrend--curr-mtx (vrend--mtx-mul3x3 vrend--curr-mtx (vrend--mtx-rotate deg)))) (defun vrend-scale (sx sy) (setq vrend--curr-mtx (vrend--mtx-mul3x3 vrend--curr-mtx (vrend--mtx-scale (float sx) (float sy))))) (defun vrend-translate (dx dy) (setq vrend--curr-mtx (vrend--mtx-mul3x3 vrend--curr-mtx (vrend--mtx-translate (float dx) (float dy))))) (defun vrend--render-path-element (e) (format "%c %s" (car e) (mapconcat '(lambda (x) (format "%f" x)) (cdr e) " "))) (defun vrend--render-path () (insert " d=\"" (mapconcat 'vrend--render-path-element (reverse vrend--curr-path) " ") "\"")) (defun vrend--render-transform () (insert (format " transform=\"matrix(%f %f %f %f %f %f)\"" (vrend--mtx-ref 0 0) (vrend--mtx-ref 1 0) (vrend--mtx-ref 0 1) (vrend--mtx-ref 1 1) (vrend--mtx-ref 0 2) (vrend--mtx-ref 1 2)))) (defun vrend-path-stroke () (insert " \n")) (defmacro vrend-with-saved-matrix (&rest body) (declare (indent 0) (debug t)) `(let ((vrend-with-saved-matrix-saved-matrix vrend--curr-mtx)) (progn ,@body (setq vrend--curr-mtx vrend-with-saved-matrix-saved-matrix)))) (defmacro vrend (width height coordinatetype &rest body) (declare (indent 3) (debug t)) (let ((width (eval width)) (height (eval height))) `(with-temp-buffer (set (make-local-variable 'vrend--curr-mtx) (vrend--mtx-ident)) (set (make-local-variable 'vrend--curr-path) nil) (set (make-local-variable 'vrend--curr-strokestyle) '("black" :width 1)) (set (make-local-variable 'vrend--curr-fillstyle) nil) (insert "\n" "\n" (format "\n") (when ,coordinatetype (vrend-translate ,(/ width 2) ,(/ height 2)) (when (eq ,coordinatetype '1x1fit) (let ((smalldir ,(min width height))) (vrend-scale (/ smalldir 2.0) (/ smalldir 2.0)))) (when (eq ,coordinatetype '1x1square) (vrend-scale ,(/ width 2.0) ,(/ height 2.0))) (vrend-scale -1.0 -1.0)) (progn ,@body) (insert "\n") (create-image (buffer-string) nil t) ))) (provide 'vrend) --------------090403080700030203000601 Content-Type: text/plain; name="vrend-example-clock.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vrend-example-clock.el" ;;; Beta quality code - use at own risk ;;; Copyright (C) 2010 Anders Waldenborg ;;; I'll add a GPL header or something like that here later... ;;; Small example on how to use vrend. ;;; Defines the command vrend-clock which creates a new buffer, ;;; Make sure you resize the window/frame and stuff like that. (require 'cl) (require 'vrend) (defun vrend-clock-update-buffer (buf) (let ((win (get-buffer-window buf t))) (when win (let* ((X (window-inside-pixel-edges win)) (w (- (car (cddr X)) (car X))) (h (- (cadr (cddr X)) (cadr X)))) (with-current-buffer buf (erase-buffer) (insert-image (vrend w h '1x1fit ;; Make hour markers... (vrend-path-start 0.0 0.8) (vrend-path-lineto 0.0 0.9) (vrend-path-close) ;; ...12 of them (loop for D from 0 to 11 by 1 do (vrend-with-saved-matrix (vrend-rotate (* D (/ vrend-2pi 12))) (vrend-path-stroke))) ;; and arrows (let* ((ct (current-time)) (T (decode-time ct)) (h (nth 2 T)) (m (nth 1 T)) (s (nth 0 T)) (ms (/ (nth 2 ct) 1000)) (seconds-since-midnight (+ (* (+ (* h 60) m) 60) s)) (seconds-since-hour (+ (* m 60) s)) (ms-since-minute (+ ms (* s 1000)))) (vrend-with-saved-matrix (vrend-path-start 0.0 0.0) (vrend-path-lineto -0.05 0.4) (vrend-path-lineto 0.0 0.6) (vrend-path-lineto 0.05 0.4) (vrend-path-close) (vrend-rotate (* seconds-since-midnight (/ vrend-2pi (* 60 60 12)))) (vrend-path-stroke)) (vrend-with-saved-matrix (vrend-path-start 0.0 0.0) (vrend-path-lineto -0.05 0.3) (vrend-path-lineto 0.0 0.90) (vrend-path-lineto 0.05 0.3) (vrend-path-close) (vrend-rotate (* seconds-since-hour (/ vrend-2pi (* 60 60)))) (vrend-path-stroke)) (vrend-with-saved-matrix (vrend-path-start 0.0 0.0) (vrend-path-lineto 0.0 0.90) (vrend-path-close) (vrend-rotate (* ms-since-minute (/ vrend-2pi 60000.0))) (vrend-path-stroke)))))))))) (defun vrend-kill-buffer-hook () (cancel-timer vrend-clock-timer)) (defun vrend-clock () (interactive) (with-current-buffer (generate-new-buffer "*aw-clock*") (set-window-buffer nil (current-buffer)) (make-local-variable 'vrend-clock-timer) (add-hook 'kill-buffer-hook 'vrend-kill-buffer-hook nil t) (setq vrend-clock-timer (run-at-time nil 0.1 'vrend-clock-update-buffer (current-buffer))))) --------------090403080700030203000601-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 13:35:55 2010 Received: (at 6230) by debbugs.gnu.org; 21 May 2010 17:35:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFW8X-0003He-DB for submit@debbugs.gnu.org; Fri, 21 May 2010 13:35:55 -0400 Received: from pantheon-po44.its.yale.edu ([130.132.50.78]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFW8U-0003HX-CR for 6230@debbugs.gnu.org; Fri, 21 May 2010 13:35:52 -0400 Received: from furry (dhcp128036014213.central.yale.edu [128.36.14.213]) (authenticated bits=0) by pantheon-po44.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o4LHZijd012558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 21 May 2010 13:35:44 -0400 Received: by furry (Postfix, from userid 1000) id 2659116D427; Fri, 21 May 2010 13:35:43 -0400 (EDT) From: Chong Yidong To: Anders Waldenborg Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used References: <4BF557EE.4050400@0x63.nu> <87r5l6v6hg.fsf@stupidchicken.com> <4BF59689.7020003@0x63.nu> <87k4qyuxf1.fsf@stupidchicken.com> <4BF62A46.10200@0x63.nu> Date: Fri, 21 May 2010 13:35:42 -0400 In-Reply-To: <4BF62A46.10200@0x63.nu> (Anders Waldenborg's message of "Fri, 21 May 2010 08:37:58 +0200") Message-ID: <87pr0pf98x.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 6230 Cc: 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Anders Waldenborg writes: > Well, I'm toying with a little vector graphics API built on top of > emacs' svg support. And my first real example is a clock. By leaving > it running for a few minutes easily makes my X server go out of > memory. You can find the library (vrend.el) and the example > implementing a clock (vrend-example-clock.el) attached. > > Not sure this clock is a real use-case. But I have a few other ideas > in mind on how to use it, which all have substantially lower > requirements on refresh rate, but probably large enough to create lots > of pixmaps in 30 minutes (which seems to be default value for > image-cache-eviction-delay) I've committed a change to the trunk that dynamically reduces the eviction delay, once the number of cached images surpasses 40. This should reduce the problem of exploding pixmap consumption. If you need better behavior, you probably have to handle it manually. One way is to call `image-refresh' on any image spec that you want to discard. This is unintuitive, but `image-refresh' actually uncaches the target image. So, if the image is no longer displayed anywhere, it will be removed from memory. (We should probably rename `image-refresh' to `image-uncache' or something like that.) From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 16:12:39 2010 Received: (at 6230) by debbugs.gnu.org; 21 May 2010 20:12:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFYaF-0004Sz-9b for submit@debbugs.gnu.org; Fri, 21 May 2010 16:12:39 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFYaD-0004Su-6z for 6230@debbugs.gnu.org; Fri, 21 May 2010 16:12:37 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAEWF9ktMCpz0/2dsb2JhbACeFHK+TYUSBIw0 X-IronPort-AV: E=Sophos;i="4.53,280,1272859200"; d="scan'208";a="64758888" Received: from 76-10-156-244.dsl.teksavvy.com (HELO pastel.home) ([76.10.156.244]) by ironport2-out.pppoe.ca with ESMTP; 21 May 2010 16:12:32 -0400 Received: by pastel.home (Postfix, from userid 20848) id 0844F81C2; Fri, 21 May 2010 16:12:32 -0400 (EDT) From: Stefan Monnier To: Chong Yidong Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used Message-ID: References: <4BF557EE.4050400@0x63.nu> <87r5l6v6hg.fsf@stupidchicken.com> <4BF59689.7020003@0x63.nu> <87k4qyuxf1.fsf@stupidchicken.com> <4BF62A46.10200@0x63.nu> <87pr0pf98x.fsf@stupidchicken.com> Date: Fri, 21 May 2010 16:12:32 -0400 In-Reply-To: <87pr0pf98x.fsf@stupidchicken.com> (Chong Yidong's message of "Fri, 21 May 2010 13:35:42 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 6230 Cc: Anders Waldenborg , 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) > be removed from memory. (We should probably rename `image-refresh' to > `image-uncache' or something like that.) I think the traditional name would be "image-flush". Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 16:43:43 2010 Received: (at 6230) by debbugs.gnu.org; 21 May 2010 20:43:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFZ4I-0004i8-R2 for submit@debbugs.gnu.org; Fri, 21 May 2010 16:43:43 -0400 Received: from phlox.netintact.se ([217.73.97.18]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFZ4G-0004i2-Ua for 6230@debbugs.gnu.org; Fri, 21 May 2010 16:43:41 -0400 Received: from hoth.proceranetworks.com (hoth.proceranetworks.com [194.153.91.41]) by phlox.netintact.se (Postfix) with ESMTP id 06CB63E8001; Fri, 21 May 2010 22:43:36 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id DC73245F0002; Fri, 21 May 2010 22:43:35 +0200 (CEST) Received: from hoth.proceranetworks.com ([127.0.0.1]) by localhost (hoth.proceranetworks.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GyJzB9-iQZZJ; Fri, 21 May 2010 22:43:31 +0200 (CEST) Received: from hidden.prnw.net (hidden.prnw.net [127.0.0.1]) by hoth.proceranetworks.com (Postfix) with ESMTP id 1332545F0001; Fri, 21 May 2010 22:43:31 +0200 (CEST) Message-ID: <4BF6F071.9080804@0x63.nu> Date: Fri, 21 May 2010 22:43:29 +0200 From: Anders Waldenborg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4 MIME-Version: 1.0 To: Chong Yidong Subject: Re: bug#6230: 23.2; Pixmaps kept in X11 after (svg?) images no longer are used References: <4BF557EE.4050400@0x63.nu> <87r5l6v6hg.fsf@stupidchicken.com> <4BF59689.7020003@0x63.nu> <87k4qyuxf1.fsf@stupidchicken.com> <4BF62A46.10200@0x63.nu> <87pr0pf98x.fsf@stupidchicken.com> In-Reply-To: <87pr0pf98x.fsf@stupidchicken.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 6230 Cc: 6230@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 05/21/2010 07:35 PM, Chong Yidong wrote: > I've committed a change to the trunk that dynamically reduces the > eviction delay, once the number of cached images surpasses 40. This > should reduce the problem of exploding pixmap consumption. > > If you need better behavior, you probably have to handle it manually. > One way is to call `image-refresh' on any image spec that you want to > discard. Excellent. Thanks for your assistance! anders From debbugs-submit-bounces@debbugs.gnu.org Sat May 22 12:48:26 2010 Received: (at control) by debbugs.gnu.org; 22 May 2010 16:48:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFrsA-0005R7-9j for submit@debbugs.gnu.org; Sat, 22 May 2010 12:48:26 -0400 Received: from pantheon-po41.its.yale.edu ([130.132.50.98]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFrs7-0005Qv-Um for control@debbugs.gnu.org; Sat, 22 May 2010 12:48:24 -0400 Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net [173.14.147.246]) (authenticated bits=0) by pantheon-po41.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o4MGmJpT006617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 22 May 2010 12:48:19 -0400 Received: by furry (Postfix, from userid 1000) id BAB8C16D427; Sat, 22 May 2010 12:48:18 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 6230 Date: Sat, 22 May 2010 12:48:18 -0400 Message-ID: <874ohz288d.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) close 6230 thanks From unknown Mon Aug 18 11:10:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Jun 2010 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator