Subject: Possible regression of Bug#26952 - "repeated buffer insertion consumes excessive memory"

From: Peter Ludemann <[email-masked]>
Date: Wed, 8 Jan 2020 08:45:38 -0800

I'm observing creeping memory increase (at one point, emacs was using over
3.8GB before I restarted it), possibly related to running compilations with
large amounts of output. Seems related to Bug#26952 (which my Bug#38629
seemed to be a duplicate of), and which was fixed in emacs 26.3. It seems
to have reappeared in emacs 28.0.50, but with a difference -- I'm not
seeing the high CPU usage that I previously observed with the high memory
use (perhaps this is because global-auto-revert has been improved in
28.0.50).

What information should I collect to confirm this problem and to help
someone debug it?

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2020-01-07 built on wistaria5b
Repository revision: 724af7671590cd91df37f64df6be73f6dca0144d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.3 LTS

Recent messages:
Reverting buffer ‘pykythe_utils.pl’.
You can run the command ‘compile’ with C-x C-g g
Reverting buffer ‘TAGS’.
Reverting buffer ‘FILES.js’. [2 times]
Reverting buffer ‘t10.kythe.json-decoded’. [2 times]
Compilation finished
You can run the command ‘garbage-collect’ with M-x ga RET
x is undefined [3 times]
Making completion list...
Quit
Quit
Configured using:
 'configure --prefix=/home/peter/emacs-2019-12-17'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER GMP

Important settings:
  value of $LC_MONETARY: en_CA.UTF-8
  value of $LC_NUMERIC: en_CA.UTF-8
  value of $LC_TIME: en_CA.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Compilation

Minor modes in effect:
  shell-dirtrack-mode: t
  global-auto-revert-mode: t
  show-paren-mode: t
  display-time-mode: t
  savehist-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
~/emacs/prolog hides
/home/peter/emacs-2019-12-17/share/emacs/28.0.50/lisp/progmodes/prolog

Features:
(shadow mail-extr emacsbug message rmc rfc822 mml mml-sec epa derived
epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail sort pulse vc vc-dispatcher
misearch multi-isearch tabify man pcmpl-unix pcmpl-gnu mule-util server
asm-mode conf-mode tar-mode arc-mode archive-mode add-log rst
haskell-mode haskell-cabal haskell-utils haskell-font-lock
haskell-indentation haskell-string haskell-sort-imports haskell-lexeme
rx haskell-align-imports haskell-compat haskell-complete-module
haskell-ghc-support flymake-proc flymake warnings dabbrev
haskell-customize doc-view jka-compr image-mode exif go-mode find-file
ffap etags fileloop generator xref project mhtml-mode css-mode sgml-mode
eww mm-url gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mail-utils wid-edit mm-util mail-prsvr url-queue url
url-proxy url-privacy url-expand url-methods url-history mailcap shr
text-property-search url-cookie url-domsuf url-util puny svg xml dom
sh-script smie executable markdown-mode color thingatpt noutline outline
dired dired-loaddefs js cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs make-mode smerge-mode diff
prolog align imenu vc-git diff-mode easy-mmode python tramp-sh tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete parse-time iso8601 time-date ls-lisp format-spec finder-inf
cl-extra help-mode autorevert filenotify grep compile comint ansi-color
ring cus-start cus-load paren time savehist desktop frameset info
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 553627 84742)
 (symbols 48 27664 5)
 (strings 32 109868 12210)
 (string-bytes 1 4407199)
 (vectors 16 47901)
 (vector-slots 8 1347908 158898)
 (floats 8 232 330)
 (intervals 56 48562 536)
 (buffers 1000 503))