GNU bug report logs - #27498
25.2; Memory leak in M-x shell

Previous Next

Package: emacs;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Mon, 26 Jun 2017 11:06:02 UTC

Severity: important

Merged with 26952, 31092, 38629

Found in versions 25.1, 25.2

Fixed in version 26.1

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 27498 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 27498 <at> debbugs.gnu.org
Subject: Re: bug#27498: 25.2; Memory leak in M-x shell
Date: Mon, 26 Jun 2017 08:01:14 -0400
forcemerge 26952 27498
quit

Ricardo Wurmus <rekado <at> elephly.net> writes:

> Emacs leaks memory as lines are printed in a shell buffer.  Here is a
> recipe:
>
>     emacs -Q
>     M-x shell
>     yes "This should not leak, but it does."
>
> Observe the memory usage grow in a tool like “top”.  Once you decide
> that Emacs has eaten enough memory, kill the shell buffer.  Note that
> memory is not released.
>
> This is a problem for me because I often compile software in shell
> buffers (via “guix build”).  The compilation processes often print out
> very large amounts of text and Emacs quickly eats up all memory on my
> machine, freezing it.  I can only recover from this by killing Emacs
> (which is terrible, because I live in Emacs).

This is Bug#26952, it's due to using the custom "GNU version of malloc"
without the "relocating allocater" (there were several bugs with the
relocating allocater in 25.1).  To fix you can configure with
REL_ALLOC=yes (this should be okay in 25.2), or use Emacs' master branch
where the standard system allocater can be used once again.




This bug report was last modified 5 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.