From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Mattner Newsgroups: gmane.emacs.devel Subject: Re: Memory again Date: Sun, 27 Nov 2011 11:29:46 +0100 Message-ID: References: <4ED0F945.5090805@yandex.ru> <83pqge7syw.fsf@gnu.org> <83mxbi7hip.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1322389800 4219 80.91.229.12 (27 Nov 2011 10:30:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 27 Nov 2011 10:30:00 +0000 (UTC) Cc: antipov@mvista.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 27 11:29:55 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 1RUbzf-0001AW-4o for ged-emacs-devel@m.gmane.org; Sun, 27 Nov 2011 11:29:55 +0100 Original-Received: from localhost ([::1]:42747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUbzd-0004cO-BO for ged-emacs-devel@m.gmane.org; Sun, 27 Nov 2011 05:29:53 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUbza-0004cE-PB for emacs-devel@gnu.org; Sun, 27 Nov 2011 05:29:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUbzZ-0003CQ-9D for emacs-devel@gnu.org; Sun, 27 Nov 2011 05:29:50 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:35554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUbzX-0003Bm-CG; Sun, 27 Nov 2011 05:29:47 -0500 Original-Received: by iaek3 with SMTP id k3so9183521iae.0 for ; Sun, 27 Nov 2011 02:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=wQHBRF8fqUuusseFPouX+rJMWjThk7xavM2DGPbFWt4=; b=OvAtSexnUsEDPeX0V2nCo8EKxcp67toLlPLuOmZixO+kkKgwoF5BL8jc2fSFAqTYwk Jahy/Gc5x0Iju/sRanJlTrzudBuXlcmmwzsLsZhIzUROo6/nVPpY+9mocoJc9HiQNG5m L8C42oSk1XRQV5eOLJ43yKi0LEgvniH0+L3rs= Original-Received: by 10.50.194.231 with SMTP id hz7mr49652025igc.7.1322389786298; Sun, 27 Nov 2011 02:29:46 -0800 (PST) Original-Received: by 10.50.190.167 with HTTP; Sun, 27 Nov 2011 02:29:46 -0800 (PST) In-Reply-To: <83mxbi7hip.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 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:146278 Archived-At: On Sat, Nov 26, 2011 at 9:31 PM, Eli Zaretskii wrote: >> Date: Sat, 26 Nov 2011 20:02:27 +0100 >> From: Carsten Mattner >> Cc: antipov@mvista.com, emacs-devel@gnu.org >> >> On Sat, Nov 26, 2011 at 5:23 PM, Eli Zaretskii wrote: >> >> Date: Sat, 26 Nov 2011 15:58:49 +0100 >> >> From: Carsten Mattner >> >> Cc: emacs-devel@gnu.org >> >> >> >> Does emacs fear the memory may be used by someone else >> >> and hold onto what it claimed? >> > >> > It doesn't, or at least shouldn't. =A0When enough memory has been >> > reclaimed by GC, it should give it away to the system. =A0At least on >> > some systems, I actually see that in action, after killing a large >> > buffer. >> >> As it's at 56.1megs at the moment after having left it open >> for a couple more hours, I guess that Dmitry's heap fragmentation >> explanation sounds most likely. > > If you start a fresh Emacs and visit a very large file, do you see the > footprint increase by approximately that file's size? =A0And if you then > kill the buffer visiting the file, do you see the footprint go down > back to almost what it was after startup? Totally unscientific data: After fresh startup: 21MB Loading xx .erl file: 21.5MB Kill buffer: 21.7MB Load 13499b .erl file again: 21.8MB Kill buffer: 21.7MB Load 13499b .erl file again: 22MB Kill buffer: 21.8MB Load 13499b .erl file again: 22.1MB Kill buffer: 22.3MB Load 13499b .erl file again: 22.2MB Kill buffer: 22.4MB Load 13499b .erl file again: 22.3MB Kill buffer: 22.4MB Load 13569b .erl file: 22.3MB Kill buffer: 22.5MB --------------- fresh startup without Ido: 21.2MB or 21.1MB C-x C-f: 21.3MB load 13499b .erl file: 21.3MB kill buffer: 21.4MB reload same .erl file: 21.5MB kill buffer: 21.6MB reload same .erl file: 21.7MB first then 21.6MB then 21.5MB kill buffer: 21.7MB first then 21.6MB reload same .erl file: 21.7MB first then 21.6MB kill buffer: 21.7MB first then N/A as I had pressed C-x C-f and then pressing C-g made Emacs.app crash. sorry :(, it sometimes crashes on C-g on Mac OS X. If we can come up with some automation to trace and save data, I'd be glad to collect that. >> I'd like to not guess but help find potential issues which >> can be corrected. >> >> How can I instrument/help find leaks or errors in the memory >> manager? > > I'd start by showing the value returned by `garbage-collect' and > comparing it with the value after startup. Where am I supposed to see the output of (garbage-collect)? Use an elisp buffer and make it print the result? Or in the Messages buffer which I usually kill on startup and disable by setting message-log-max to nil.