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: Wed, 07 Dec 2011 09:01:27 -0500 Message-ID: References: <4ED0F945.5090805@yandex.ru> <83pqge7syw.fsf@gnu.org> <87mxb6tkji.fsf@wanadoo.es> <4EDDED4B.7030607@yandex.ru> <8362htbos6.fsf@gnu.org> <4EDF20A7.6090701@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323266516 13345 80.91.229.12 (7 Dec 2011 14:01:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Dec 2011 14:01:56 +0000 (UTC) Cc: Dmitry Antipov , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 07 15:01:41 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 1RYI42-0004ub-Ra for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 15:01:38 +0100 Original-Received: from localhost ([::1]:34852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYI41-0008GP-UJ for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 09:01:37 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:56050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYI3u-0008Ej-Kv for emacs-devel@gnu.org; Wed, 07 Dec 2011 09:01:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYI3t-0003Zg-LE for emacs-devel@gnu.org; Wed, 07 Dec 2011 09:01:30 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYI3t-0003ZT-IR; Wed, 07 Dec 2011 09:01:29 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id pB7E1RXx002096; Wed, 7 Dec 2011 09:01:28 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 35DBB59403; Wed, 7 Dec 2011 09:01:27 -0500 (EST) In-Reply-To: (Eli Zaretskii's message of "Wed, 07 Dec 2011 08:06:43 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4063=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4063> : streams <708581> : uri <1023399> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:146547 Archived-At: >> > You are, in fact, saying that fontifying a 60-MByte compilation buffer >> > creates text properties and other supporting data structures that can >> > accrue to a total of 2G bytes. I find this extremely hard to believe. >> > A simple calculation will show that a file that has 1 million lines >> > with 5 different faces (warning, line number, column number, >> > underline, default) per line needs only a few million intervals -- how >> > can this require 2G bytes of memory? Because the property values are themselves non-trivial. >> Start fresh Emacs instance, make sure you're in *scratch*. Type M-x >> compilation-minor-mode, then eval (staying in *scratch*, of course): >> >> (let ((x 0)) (while (< x 1000000) (insert "test:1:oops\n") (setq x (1+ x)))) >> >> Wait for completion, then see RSS. Next, kill *scratch*, M-x garbage-collect >> and see RSS again. > How is this different from compiling a C file with 1000000 #warning > directives? What am I missing? To test your buffer-reallocation theory, you could instead do (insert (apply #'concat (make-list 1000000 "test:1:oops\n"))) Stefan