Subject: bug#37006: Emacs 27 master consumes more memory than 26 and freezes regularly

From: Joseph Mingrone <[email-masked]>
Date: Thu, 05 Sep 2019 13:12:11 -0300

Paul Eggert <[email-masked]> writes:

> Paul Eggert wrote:
>> Eli Zaretskii wrote:
>>> once
>>> gc-cons-threshold is set to a large value, it effectively disables GC
>>> for the rest of the session, even if after that gc-cons-threshold is
>>> reset back
>> Yes, that's next on my list of things to look at, after untangling this XDG 
>> configuration mess.

> Although I haven't finished untangling the XDG configuration mess, I did get some time free to attack the gc-cons-threshold issue and installed the attached. 
> As this should fix the problem reported in Bug#37006 I'm boldly closing that bug report.

This issue still exists for me.  After rebuilding on 5f089ac, I re-added
the (setq gc-cons-threshold most-positive-fixnum) / (setq
gc-cons-threshold 800000) surrounding init.el (assuming the issue was
fixed) then when Emacs' memory usage was over 2 GB, I turned on
`garbage-collection-messages', opened some large files, and could see
that garbage collection was not happening.

I just removed the surrounding (setq gc-cons-threshold
most-positive-fixnum) / (setq gc-cons-threshold 800000) and I see
garbage collection is happening for now.  I will report back if this
does not remain so.  In the last week or two running on a commit that
was some time after a recent fix (sorry, don't have the exact commit)
garbage collection was happening and the memory usage was not exploding.
The `gc-cons-threshold' hack in init.el was commented out.