From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21556: 25.0.50; Memory leak in emacs -Q with lucid (font) Date: Sun, 27 Sep 2015 11:09:18 +0300 Message-ID: <83io6wffm9.fsf@gnu.org> References: <87zj082t34.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1443341433 28609 80.91.229.3 (27 Sep 2015 08:10:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Sep 2015 08:10:33 +0000 (UTC) Cc: dmantipov@yandex.ru, 21556@debbugs.gnu.org To: handa@gnu.org (K. Handa), Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 27 10:10:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zg72A-0000eR-3q for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Sep 2015 10:10:10 +0200 Original-Received: from localhost ([::1]:56505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg729-0004PT-RX for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Sep 2015 04:10:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg726-0004OF-To for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 04:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zg722-0004hS-Ss for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 04:10:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg722-0004h0-Ql for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 04:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zg722-0005pe-9z for bug-gnu-emacs@gnu.org; Sun, 27 Sep 2015 04:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Sep 2015 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21556 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21556-submit@debbugs.gnu.org id=B21556.144334136822372 (code B ref 21556); Sun, 27 Sep 2015 08:10:02 +0000 Original-Received: (at 21556) by debbugs.gnu.org; 27 Sep 2015 08:09:28 +0000 Original-Received: from localhost ([127.0.0.1]:45493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zg71T-0005om-GA for submit@debbugs.gnu.org; Sun, 27 Sep 2015 04:09:27 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:46374) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zg71Q-0005oc-8K for 21556@debbugs.gnu.org; Sun, 27 Sep 2015 04:09:25 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NVB00400SX6EC00@mtaout24.012.net.il> for 21556@debbugs.gnu.org; Sun, 27 Sep 2015 11:02:10 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVB00MNRSZMEC30@mtaout24.012.net.il>; Sun, 27 Sep 2015 11:02:10 +0300 (IDT) In-reply-to: <87zj082t34.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106959 Archived-At: > From: handa@gnu.org (K. Handa) > Cc: 21556@debbugs.gnu.org, dmantipov@yandex.ru > Date: Sun, 27 Sep 2015 16:56:47 +0900 > > When I wrote the original code long ago, font listing and opening > was very slow on GNU/Linux system. So I tried to cache the result > of listing as far as possible, and also tried to reuse the once > opened font object as far as possible. The latter means that even > if a font object once created becomes unnecessary (perhaps because a > frame is deleted), it is not freed, because, once a user displayed a > specific character, it is displayed again with a very high > possibility. So, when a font is closed? It is closed by an > explicit call of clear-font-fache. As far as I remember (though > vaguely), that was my original intention. So maybe we should simply remove (or ifdef away) the code that compacts the font caches. If your assumption about reusing the font is anywhere near the truth, compacting the font cache gives us more trouble than it gains: we get slow redisplay in some cases and random hard-to-debug bugs, while the gains are only visible in very rare use cases such as the one described in the Oct 2013 discussion.