From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Memory again Date: Tue, 06 Dec 2011 17:28:19 +0100 Message-ID: <87borlu0kc.fsf@wanadoo.es> References: <4ED0F945.5090805@yandex.ru> <83pqge7syw.fsf@gnu.org> <87mxb6tkji.fsf@wanadoo.es> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323188942 27002 80.91.229.12 (6 Dec 2011 16:29:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2011 16:29:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 06 17:28:57 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 1RXxt2-00078f-S9 for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2011 17:28:56 +0100 Original-Received: from localhost ([::1]:35227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXxt1-0003av-Vu for ged-emacs-devel@m.gmane.org; Tue, 06 Dec 2011 11:28:55 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXxsu-0003ZM-Ng for emacs-devel@gnu.org; Tue, 06 Dec 2011 11:28:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXxso-0005u3-QL for emacs-devel@gnu.org; Tue, 06 Dec 2011 11:28:48 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:56150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXxso-0005tv-EX for emacs-devel@gnu.org; Tue, 06 Dec 2011 11:28:42 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RXxsm-000715-KD for emacs-devel@gnu.org; Tue, 06 Dec 2011 17:28:40 +0100 Original-Received: from 137.red-88-11-104.dynamicip.rima-tde.net ([88.11.104.137]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Dec 2011 17:28:40 +0100 Original-Received: from ofv by 137.red-88-11-104.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Dec 2011 17:28:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 137.red-88-11-104.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:iIFrpNaqzfT8StXkRq8rdQl9KaA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:146508 Archived-At: Eli Zaretskii writes: >> Just for the record: a *compile* buffer ended with 10M lines of >> diagnostics emitted by a compiler. The emacs process jumped from 60MB to >> 526MB of RES memory. > > On what OS? Kubuntu 11.8 Linux version 3.0.0-13-generic #22-Ubuntu SMP x86_64. > And was the size of the buffer comparable with 520MB? Dunno. With the same emacs process (which is running as a daemon) after repeating the steps that created that monster *compile* buffer I got: Size, as reported by ibuffer: 29843302 Size of the file after saving the buffer's contents: 29843327 Number of lines: 1053239 (not 10M as reported on my previous msg) The RES memory used by emacs stayed at 526MB. Another issue is that if you press M-> (end-of-buffer) on that *compile* buffer emacs uses 100% cpu and does freezes, apparently. After a while (half a minute or so) pressing C-g makes emacs alive again and the point is at the end of the *compile* buffer. Possibly it was fontifying the buffer, as the last half of it is not fontified. After this, the RES memory used by emacs increased to 554MB (from 526). A bit later it went back to 526MB. Jumping at random on the buffer for a while increased the memory usage to 533MB. Again, killing that *compile* buffer makes no difference on the memory used by emacs as reported by htop. >> That was yesterday, and emacs keeps retaining that memory. > > Are you saying that you killed the *compilation* buffer and Emacs > memory footprint didn't change at all? I find that hard to believe. I'm writing this message on that very same emacs process. Right now it has 60 buffers, all of them with a size below 50KB and most below 10KB. As reported by `htop', the process is using 533MB of RES memory and 630MB of VIRT memory. >> I guess that as the buffer grew it was reallocated again and >> again. Obviously fragmentation is at play here. > > If ralloc.c is used on the system where you did that, fragmentation > should be prevented, especially in buffer text reallocations. If > ralloc.c is not used, I believe Emacs relies on the system's memory > allocation to avoid fragmentation (that's why ralloc.c is not needed > on those systems).