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: Re: Memory again Date: Mon, 19 Dec 2011 06:26:26 -0500 Message-ID: References: <4ED0F945.5090805@yandex.ru> <83pqge7syw.fsf@gnu.org> <87mxb6tkji.fsf@wanadoo.es> <87borlu0kc.fsf@wanadoo.es> <4EEE0315.60405@yandex.ru> <4EEEF5B4.3050806@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1324294017 31751 80.91.229.12 (19 Dec 2011 11:26:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Dec 2011 11:26:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 19 12:26:53 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RcbMr-0004iz-1n for ged-emacs-devel@m.gmane.org; Mon, 19 Dec 2011 12:26:53 +0100 Original-Received: from localhost ([::1]:37088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcbMq-0002qj-Eb for ged-emacs-devel@m.gmane.org; Mon, 19 Dec 2011 06:26:52 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcbMj-0002pG-8I for emacs-devel@gnu.org; Mon, 19 Dec 2011 06:26:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcbMS-0004uL-Je for emacs-devel@gnu.org; Mon, 19 Dec 2011 06:26:45 -0500 Original-Received: from smtp-01.vtx.ch ([194.38.175.90]:43472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcbMS-0004tm-Ed for emacs-devel@gnu.org; Mon, 19 Dec 2011 06:26:28 -0500 Original-Received: from ceviche.home (dyn.144-85-186-064.dsl.vtx.ch [144.85.186.64]) by smtp-01.vtx.ch (VTX Services SA) with ESMTP id 526AE289E3; Mon, 19 Dec 2011 12:26:27 +0100 (CET) Original-Received: by ceviche.home (Postfix, from userid 20848) id 0E4466612F; Mon, 19 Dec 2011 06:26:26 -0500 (EST) In-Reply-To: <4EEEF5B4.3050806@yandex.ru> (Dmitry Antipov's message of "Mon, 19 Dec 2011 12:28:36 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.38.175.90 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146818 Archived-At: >> `garbage-collect' is supposed to give that info. At least it does give >> info about the data that's kept under alloc.c's control because >> of fragmentation (these are counted as "free cells"). > I would like to propose a function which explicitly says how much free memory > the Emacs process holds. For the part that alloc.c holds, the "memory-usage" package in ELPA should do the trick (or can be improved to do it). > It's especially useful when there is a way to ask system malloc about > how much free memory is in the heap. It'd be great to add this data when available, indeed. Patch welcome. > This may be helpful to distinguish real heap fragmentation from memory > leaks and other misuses - if the sum of values returned by > 'memory-free' is, say, 10% of heap size, then the real fragmentation > enters into the game. It may also be important to try and keep track of other allocations, which are not under alloc.c's control (e.g. allocations performed by GUI libraries). >> I agree that we're probably going to see better overall results by >> improving general memory use than by trying to attack >> fragmentation problems. > Among this list's subscribers, Nix is constantly > reporting an enormous memory usage caused by Gnus. I think we still have a leak there somewhere. Stefan