From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#26952: 25.1; loops eating all memory while yanking big rectangle Date: Sun, 21 May 2017 18:28:12 +0300 Message-ID: <83y3tqnsab.fsf@gnu.org> References: <87zie8gyu4.fsf@users.sourceforge.net> <83h90fq269.fsf@gnu.org> <87vaovh1db.fsf@users.sourceforge.net> <8360gvpfxr.fsf@gnu.org> <87shjzgwgk.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1495380550 24369 195.159.176.226 (21 May 2017 15:29:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 May 2017 15:29:10 +0000 (UTC) Cc: 26952@debbugs.gnu.org To: npostavs@users.sourceforge.net, Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 21 17:29:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCSn3-0006E6-Il for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 May 2017 17:29:05 +0200 Original-Received: from localhost ([::1]:38360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCSn9-00025t-8w for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 May 2017 11:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCSn3-00025l-Lx for bug-gnu-emacs@gnu.org; Sun, 21 May 2017 11:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCSn0-0006o7-Hl for bug-gnu-emacs@gnu.org; Sun, 21 May 2017 11:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dCSn0-0006o3-Eb for bug-gnu-emacs@gnu.org; Sun, 21 May 2017 11:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dCSn0-0002lE-9G for bug-gnu-emacs@gnu.org; Sun, 21 May 2017 11:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 May 2017 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26952-submit@debbugs.gnu.org id=B26952.149538052010583 (code B ref 26952); Sun, 21 May 2017 15:29:02 +0000 Original-Received: (at 26952) by debbugs.gnu.org; 21 May 2017 15:28:40 +0000 Original-Received: from localhost ([127.0.0.1]:59487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCSme-0002kd-Ig for submit@debbugs.gnu.org; Sun, 21 May 2017 11:28:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCSmd-0002kP-2L for 26952@debbugs.gnu.org; Sun, 21 May 2017 11:28:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCSmW-0006bP-UB for 26952@debbugs.gnu.org; Sun, 21 May 2017 11:28:33 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCSmR-0006Zn-Jz; Sun, 21 May 2017 11:28:27 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3717 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dCSmQ-0001ox-MZ; Sun, 21 May 2017 11:28:27 -0400 In-reply-to: <87shjzgwgk.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132698 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 26952@debbugs.gnu.org, pot@gnu.org > Date: Sat, 20 May 2017 15:27:39 -0400 > > > So you are saying that inserting 90MB worth of text into a buffer > > makes Emacs 25.2 run out of 1GB of memory, due to inefficiencies of > > the malloc implementation? > > When it's inserted in small chunks, yes, I think so. What seems to > happen is that the buffer gap keeps getting realloc'd to be slightly > bigger, and the deallocated chunks don't get reused. > > > (Here on Windows it produces a 230MB Emacs > > session, but the Windows build uses the moral equivalent of mmap for > > allocating buffer text.) > > Neither master nor emacs-25 are using mmap (according to configure > output), but I guess the "hybrid" or relocating allocaters are smart > enough to handle this case. I cannot see why. AFAIK, the only difference between using the hybrid allocation and not using it is before Emacs is dumped; after that both use the same system malloc. So if the hybrid malloc fixed this, the problem is somehow related to the memory allocation before dumping. Maybe reallocating a gap that was allocated before dumping somehow exposes a bug? Paul, is it feasible to back-port the hybrid allocation to the emacs-25 branch? This sounds like a nasty bug, so if we can safely fix it, I think we ought to release Emacs 25.3 with just this issue fixed. WDYT?