From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Memory again Date: Wed, 07 Dec 2011 02:52:17 -0500 Message-ID: References: <4ED0F945.5090805@yandex.ru> <83pqge7syw.fsf@gnu.org> <87mxb6tkji.fsf@wanadoo.es> <4EDDED4B.7030607@yandex.ru> <8362htbos6.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1323244349 20467 80.91.229.12 (7 Dec 2011 07:52:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Dec 2011 07:52:29 +0000 (UTC) Cc: dmantipov@yandex.ru, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 07 08:52:25 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 1RYCIg-0001nh-J8 for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 08:52:22 +0100 Original-Received: from localhost ([::1]:41994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYCIg-0005RB-6R for ged-emacs-devel@m.gmane.org; Wed, 07 Dec 2011 02:52:22 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYCId-0005Qt-9P for emacs-devel@gnu.org; Wed, 07 Dec 2011 02:52:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYCIc-0004au-6M for emacs-devel@gnu.org; Wed, 07 Dec 2011 02:52:19 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:52786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYCIc-0004aq-3l for emacs-devel@gnu.org; Wed, 07 Dec 2011 02:52:18 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RYCIb-0000N7-M2; Wed, 07 Dec 2011 02:52:17 -0500 In-reply-to: (message from Stefan Monnier on Tue, 06 Dec 2011 15:25:59 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:146532 Archived-At: > From: Stefan Monnier > Cc: dmantipov@yandex.ru, emacs-devel@gnu.org > Date: Tue, 06 Dec 2011 15:25:59 -0500 > > > Anyway, the theory behind this experiment is that inserting lots of > > text in small chunks causes massive reallocations, one each for every > > time you fill the gap, and this fragmentation of the memory, which > > then makes it impossible to release more than the last 60MB. > > I doubt that's what happens. I think instead that the extra memory is > what is used by the various text properties we add. 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?