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: Sat, 20 May 2017 20:59:44 +0300 Message-ID: <8360gvpfxr.fsf@gnu.org> References: <87zie8gyu4.fsf@users.sourceforge.net> <83h90fq269.fsf@gnu.org> <87vaovh1db.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1495303294 21970 195.159.176.226 (20 May 2017 18:01:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 May 2017 18:01:34 +0000 (UTC) Cc: 26952@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 20 20:01:30 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 1dC8gv-0005Us-LG for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 May 2017 20:01:25 +0200 Original-Received: from localhost ([::1]:35024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dC8h0-00080j-Tb for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 May 2017 14:01:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dC8gu-00080c-Up for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 14:01:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dC8gr-0008FF-Ty for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 14:01:25 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dC8gY-00088l-EJ for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 14:01:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dC8gY-0007z5-3d for bug-gnu-emacs@gnu.org; Sat, 20 May 2017 14:01: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: Sat, 20 May 2017 18:01: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.149530323130642 (code B ref 26952); Sat, 20 May 2017 18:01:02 +0000 Original-Received: (at 26952) by debbugs.gnu.org; 20 May 2017 18:00:31 +0000 Original-Received: from localhost ([127.0.0.1]:57234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dC8g3-0007yA-51 for submit@debbugs.gnu.org; Sat, 20 May 2017 14:00:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dC8g1-0007xy-6a for 26952@debbugs.gnu.org; Sat, 20 May 2017 14:00:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dC8fv-0007xu-8r for 26952@debbugs.gnu.org; Sat, 20 May 2017 14:00:24 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dC8fp-0007w8-9N; Sat, 20 May 2017 14:00:17 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2990 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dC8fn-0008Cj-B5; Sat, 20 May 2017 14:00:16 -0400 In-reply-to: <87vaovh1db.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:132677 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 26952@debbugs.gnu.org, pot@gnu.org > Date: Sat, 20 May 2017 13:41:36 -0400 > > The following simple loop can trigger the issue (I'm now also limiting > Emacs' memory usage to 1GB with "ulimit -Sv $((1000 * 1024))" so that it > just throws an out of memory error instead of filling my swap and > slowing everything down): > > (let ((str (make-string 150 ?a))) > (dotimes (_ (* 600 1000)) > (insert str ?\n))) > > I think it might be just an inefficient allocater (or this pattern of > allocation happens to hit a pathological case for the allocater). The > master branch is using the 'hybrid' allocater, while emacs-25 is not. > If I configure 25.2 with REL_ALLOC=yes, then it runs okay. The only > allocation seems to be from 'enlarge_buffer_text'. Thanks. 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? (Here on Windows it produces a 230MB Emacs session, but the Windows build uses the moral equivalent of mmap for allocating buffer text.) Maybe we should release Emacs 25.3 with this single problem fixed?