From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Memory leak in keyboard variables? Date: Mon, 15 Dec 2008 10:26:05 +0900 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1229304414 16972 80.91.229.12 (15 Dec 2008 01:26:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Dec 2008 01:26:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 15 02:27:59 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 1LC2FW-0002cO-9Q for ged-emacs-devel@m.gmane.org; Mon, 15 Dec 2008 02:27:54 +0100 Original-Received: from localhost ([127.0.0.1]:56688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LC2EK-0007Op-9J for ged-emacs-devel@m.gmane.org; Sun, 14 Dec 2008 20:26:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LC2EF-0007Mi-9n for emacs-devel@gnu.org; Sun, 14 Dec 2008 20:26:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LC2EC-0007Lj-Nb for emacs-devel@gnu.org; Sun, 14 Dec 2008 20:26:34 -0500 Original-Received: from [199.232.76.173] (port=35986 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LC2EC-0007Ld-Hr for emacs-devel@gnu.org; Sun, 14 Dec 2008 20:26:32 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:65308) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LC2EB-0004sn-Ta for emacs-devel@gnu.org; Sun, 14 Dec 2008 20:26:32 -0500 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id mBF1Q6cO016742 for ; Mon, 15 Dec 2008 10:26:06 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id mBF1Q6C4001845 for ; Mon, 15 Dec 2008 10:26:06 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id mBF1Q6Qu021337 for ; Mon, 15 Dec 2008 10:26:06 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1LC2Dl-0001R1-VC for emacs-devel@gnu.org; Mon, 15 Dec 2008 10:26:05 +0900 User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:106919 Archived-At: > 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