From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Weird memory consumption libnked to frame font spec Date: Fri, 24 Apr 2009 00:00:36 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240545659 23937 80.91.229.12 (24 Apr 2009 04:00:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2009 04:00:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 24 06:02:18 2009 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 1LxCcC-00081L-B0 for ged-emacs-devel@m.gmane.org; Fri, 24 Apr 2009 06:02:16 +0200 Original-Received: from localhost ([127.0.0.1]:47815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxCan-0003yn-9u for ged-emacs-devel@m.gmane.org; Fri, 24 Apr 2009 00:00:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LxCai-0003yW-6i for emacs-devel@gnu.org; Fri, 24 Apr 2009 00:00:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LxCad-0003y8-Lo for emacs-devel@gnu.org; Fri, 24 Apr 2009 00:00:43 -0400 Original-Received: from [199.232.76.173] (port=49148 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxCad-0003y5-8F for emacs-devel@gnu.org; Fri, 24 Apr 2009 00:00:39 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:50176 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LxCac-0006G8-Ov for emacs-devel@gnu.org; Fri, 24 Apr 2009 00:00:38 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQEAOPV8ElMCrUB/2dsb2JhbACBUM5Ug3QFhS4 X-IronPort-AV: E=Sophos;i="4.40,239,1238990400"; d="scan'208";a="37542076" Original-Received: from 76-10-181-1.dsl.teksavvy.com (HELO pastel.home) ([76.10.181.1]) by ironport2-out.teksavvy.com with ESMTP; 24 Apr 2009 00:00:36 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0D0C27EFE; Fri, 24 Apr 2009 00:00:36 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (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:110448 Archived-At: There's something funny with our memory consumption. Here is a recipe to show the problem, tho it uses mpc.el (and requires an mpd daemon running), so you may find it rather inconvenient to try and reproduce it. Hopefully I'll find a way to get rid of this mpc.el dependency to reproduce the bug, but for now, that's what we have: - emacs -Q --eval '(dotimes (i 10 (other-frame 1)) (make-frame (quote ((font . "Sans")))))' -l ~/src/elisp/mpc/mpc.el -f mpc - at this point, you're supposed to be looking at 11 frames, the bottom one using the default font to show *scratch*, the 9 middle ones showing *scratch* as well but using "Sans", and the top one also using "Sans" but showing various windows listing the artists&albums&... available in your MPD daemon. "ps" should show your Emacs process is largish, but not humongous (in my case it's about 60MB). - Now middle click on some artist in the artist list to select it. This should modify most of the buffers in the MPC frame, tho nothing really particular: they don't get much longer, they don't use new charsets (they may, but at least in my test case they don't), ... This is done by sending various commands to the MPD daemon (via one TCP connection) and receiving responses in return through the process filter. Yet, the process size of this running Emacs has jumped up by an enormous chunk (to 190MB in my case). Now you might think "well, now, this mpc.el of yours is doing something really fishy to eat up so much memory". But as turns out, If I repeat this test but passing nil to make-frame rather than (quote ((font . "Sans"))), the memory use is a bit lower to start with (like 58MB instead of 60MB) and rather than jump up to 190MB it only slightly increases to 59MB. Also the data returned by `garbage-collect' seems to indicate that most of that memory is not spent on Lisp data. So the problem seems linked to the handling of fonts rather than to mpc.el. Even without this bug, I find that every frame I create causes the memory size to jump by almost 1MB, which I find rather large but maybe explainable. OTOH this jump in size really looks like a bug. Stefan