From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Memory leak in keyboard variables? Date: Fri, 19 Dec 2008 20:50:56 -0500 Message-ID: <87ocz7pqbj.fsf@cyd.mit.edu> References: <87d4fzh0qc.fsf@cyd.mit.edu> <87y6ymiw93.fsf@cyd.mit.edu> <8763lqcuju.fsf@stupidchicken.com> <87bpvccirc.fsf@cyd.mit.edu> <877i5z1kka.fsf@xemacs.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229737876 20828 80.91.229.12 (20 Dec 2008 01:51:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2008 01:51:16 +0000 (UTC) Cc: Markus Triska , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 20 02:52:19 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LDr0r-000734-7M for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2008 02:52:17 +0100 Original-Received: from localhost ([127.0.0.1]:49657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDqze-0000Il-NS for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2008 20:51:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LDqza-0000Ig-HF for emacs-devel@gnu.org; Fri, 19 Dec 2008 20:50:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LDqzZ-0000IU-3R for emacs-devel@gnu.org; Fri, 19 Dec 2008 20:50:58 -0500 Original-Received: from [199.232.76.173] (port=55195 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDqzY-0000IR-Tt for emacs-devel@gnu.org; Fri, 19 Dec 2008 20:50:56 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]:32909) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LDqzW-0005ym-Io for emacs-devel@gnu.org; Fri, 19 Dec 2008 20:50:56 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id EB4AB57E204; Fri, 19 Dec 2008 20:50:56 -0500 (EST) In-Reply-To: <877i5z1kka.fsf@xemacs.org> (Stephen J. Turnbull's message of "Wed, 17 Dec 2008 13:40:05 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107085 Archived-At: "Stephen J. Turnbull" writes: > Chong Yidong writes: > > Markus Triska writes: > > > > > Please also try emacsclient with "-c" instead of "-t" - there seems to > > > be a probably different and still quite big leak there as will. > > > > With the recent fix to font_clear_cache, the leak is reduced to 30-40k > > per frame. This leak seems to be tied to GTK and X toolkits somehow. > > It does not appear when Emacs is compiled with --with-x-toolkit=no. > > The toolkits undoubtedly do their own font caching, and probably won't > release the space until Emacs exits. Yes, this is a possibility. Another data point: the leak occurs when the menu-bar is enabled, but not when the menu-bar is disabled. It's not necessary to see the leak using Emacsclient, as ordinary frame creating/deletion shows it: (dotimes (i 15) (let* ((params '((window-system . x) (menu-bar-lines . 1) (tool-bar-lines . 1))) frame) (setq frame (x-create-frame params)) (delete-frame frame) (garbage-collect))) I have not been able to track down the source of this leak within Emacs. As far as I can tell, the existing menu-bar items allocation functions (in xmenu.c, menu.c, keyboard.c, and gtkutil.c) free all the memory they allocate, yet about 10k of memory remains unfreed with each frame created.