GNU logs - #43395, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: 28.0.50; memory leak
Resent-From: Madhu <enometh@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 14 Sep 2020 05:37:01 +0000
Resent-Message-ID: <handler.43395.B.160006177529202 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 43395 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.160006177529202
          (code B ref -1); Mon, 14 Sep 2020 05:37:01 +0000
Received: (at submit) by debbugs.gnu.org; 14 Sep 2020 05:36:15 +0000
Received: from localhost ([127.0.0.1]:52283 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kHh9z-0007aw-A1
	for submit <at> debbugs.gnu.org; Mon, 14 Sep 2020 01:36:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:59088)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <enometh@HIDDEN>) id 1kHh9v-0007am-Bm
 for submit <at> debbugs.gnu.org; Mon, 14 Sep 2020 01:36:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:60112)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <enometh@HIDDEN>) id 1kHh9v-0003AN-4j
 for bug-gnu-emacs@HIDDEN; Mon, 14 Sep 2020 01:36:11 -0400
Received: from [117.254.34.178] (port=46316 helo=localhost.localdomain)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <enometh@HIDDEN>) id 1kHh9s-0007Ok-DD
 for bug-gnu-emacs@HIDDEN; Mon, 14 Sep 2020 01:36:10 -0400
Received: (qmail 24339 invoked by uid 500); 14 Sep 2020 04:53:53 -0000
From: Madhu <enometh@HIDDEN>
Date: Sat, 12 Sep 2020 07:42:42 +0530
Message-ID: <m34ko3215x.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Host-Lookup-Failed: Reverse DNS lookup failed for 117.254.34.178 (failed)
Received-SPF: softfail client-ip=117.254.34.178; envelope-from=enometh@HIDDEN;
 helo=localhost.localdomain
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 00:55:11
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy]
X-Spam_score_int: 29
X-Spam_score: 2.9
X-Spam_bar: ++
X-Spam_report: (2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_PBL=3.335,
 RDNS_NONE=0.793, SPF_HELO_NONE=0.001,
 SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


Following up on the thread:
https://lists.gnu.org/archive/html/help-gnu-emacs/2020-09/msg00147.html

There appears to be a memory leak with emacs RSS growing inordinately in
size.

$ ps o pid,rss,drs,sz,share,start_time,vsize,cmd 26285
  PID   RSS   DRS  SIZE - START    VSZ CMD
26285 2643236 2996379 2664940 - Sep09 2998948 /7/gtk/emacs/build-xt-xft/src/emacs --debug-init --daemon

I usually only notice the leak when it has gone beyond 2G - when linux
refuses to suspend because I have limited swap.  In most cases emacs
would be running for a few days.

The values reported by garbage-collect amount do not reflect the 2GB
allocation being used by emacs.

Advice on tooling is called for to instrument emacs and monitor the
system for memory changes and flag the point when the leak occurs.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2020-09-06 built on maher
Emacs Repository revision: 6fc502c1ef327ab357c971b9bffbbd7cb6a436f1
Repository branch: madhu-tip
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Gentoo/Linux

Configured using:
 'configure -C --with-harfbuzz --without-cairo --with-x-toolkit=athena
 --with-xft'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS JSON
PDUMPER LCMS2

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  global-log4sly-mode: t
  global-magit-file-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  other-frame-window-mode: t
  savehist-mode: t
  xclip-mode: t
  dired-single-mode: t
  save-place-mode: t
  recentf-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  minibuffer-depth-indicate-mode: t
  display-time-mode: t
  which-function-mode: t
  foomadhu-clear-output-mode: t
  foomadhu-translate-kbd-paren-mode: t
  new-shell-activate-mode: t
  foomadhu-mode: t
  ivy-prescient-mode: t
  prescient-persist-mode: t
  ivy-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:

Features:
(shadow emacsbug sendmail proced meson-mode yaml-mode idlwave
idlwave-help idlw-help desktop frameset mhtml-mode tex-mode latexenc
net-utils url-file url-dired vc-filewise cal-china lunar cal-bahai
cal-islam cal-hebrew holidays hol-loaddefs markdown-mode eieio-opt
speedbar ezimage dframe nndir tabify man wdired log-view log4sly nnagent
nnml mule-util ibuf-ext ibuffer ibuffer-loaddefs cal-julian solar
cal-dst conf-mode cl-indent dabbrev ielm html5-schema css-mode eww
url-queue mm-url scroll-lock rng-xsd xsd-regexp rng-cmpct python js
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs vc-rcs vc vc-dispatcher bug-reference make-mode
magit-bookmark magit-imenu git-rebase magit-extras magit-gitignore
magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util magit-subtree magit-patch magit-submodule
magit-obsolete magit-popup magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log magit-diff magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process magit-mode git-commit transient magit-git magit-section
magit-utils crm log-edit pcvs-util with-editor async-bytecomp async dash
vc-git sly-mk-defsystem grep sly-undefmethod sly-fancy sly-tramp
sly-stickers pulse hi-lock sly-trace-dialog sly-fontifying-fu
sly-package-fu sly-scratch sly-fancy-trace sly-fancy-inspector sly-mrepl
sly-autodoc sly-parse warnings sly-c-p-c sly-retro sly gud
sly-completion sly-buttons sly-messages sly-common apropos arc-mode
archive-mode hyperspec ebuild-mode skeleton sh-script smie executable
two-column iso-transl smerge-mode diff-mode nnfolder canlock org-element
avl-tree ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus nnir ol-docview
doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m
org-capture flow-fill mm-archive qp view help-fns radix-tree cl-print
debug backtrace sort gnus-cite mail-extr gnus-bcklg gnus-async gnus-kill
gnus-ml epa-file gnutls nndraft nnmh nnnil gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-cache gnus-art mm-uu
mml2015 mm-view mml-smime smime dig gnus-sum url url-proxy url-privacy
url-expand url-methods url-history mailcap shr kinsoku url-cookie
url-domsuf url-util svg nntp gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int
gnus-range message rfc822 mml mml-sec epa epg epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
gnus-win misearch multi-isearch network-stream puny nsm rmc bookmark
time-stamp mew-varsx dired-aux term/xterm xterm add-log pinentry
other-frame-window lw-manual lw-manual-data-7-1-0-0 savehist xclip
elisp-slime-nav gnus nnheader gnus-util rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums text-property-search mail-utils mm-util mail-prsvr
company pcase cus-start cus-load ggtags etags fileloop generator ewoc
zenicb-color zenicb-whereis zenicb-complete zenicb-stamp zenicb-history
zenicb-away zenicb zenirc-sasl erc-goodies erc erc-backend pp
erc-loaddefs zenirc-color zenirc-stamp zenirc-trigger zenirc-notify
zenirc-netsplit zenirc-ignore zenirc-history zenirc-format zenirc-dcc
zenirc-complete zenirc-command-queue zenirc-away zenirc sly-autoloads
org-mew mew-auth mew-config mew-imap2 mew-imap mew-nntp2 mew-nntp
mew-pop mew-smtp mew-ssl mew-ssh mew-net mew-highlight mew-sort mew-fib
mew-ext mew-refile mew-demo mew-attach mew-draft mew-message mew-thread
mew-virtual mew-summary4 mew-summary3 mew-summary2 mew-summary
mew-search mew-pick mew-passwd mew-scan mew-syntax mew-bq mew-smime
mew-pgp mew-header mew-exec mew-mark mew-mime mew-unix mew-edit
mew-decode mew-encode mew-cache mew-minibuf mew-complete mew-addrbook
mew-local mew-vars3 mew-vars2 mew-vars mew-env mew-mule3 mew-mule
mew-gemacs mew-key mew-func mew-blvs mew-const mew winner windmove
whitespace tramp-sh tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat ls-lisp ange-ftp term disp-table ehelp saveplace
recentf tree-widget wid-edit paren ob-lisp ob-shell shell org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src
ob-comint org-pcomplete pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table ol
org-keys org-compat org-macs org-loaddefs format-spec find-func cal-menu
calendar cal-loaddefs rng-nxml rng-valid rng-loc rng-uri rng-parse
nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode
nxml-outln nxml-rap sgml-mode dom nxml-util nxml-enc xmltok mb-depth
ffap thingatpt battery dbus xml time which-func imenu parse-time iso8601
time-date cookie1 server diff generic derived easy-mmode dired-x
gh-common marshal eieio-compat info rx finder-inf package browse-url
url-handlers url-parse auth-source password-cache json url-vars cl
ivy-prescient prescient subr-x map edmacro kmacro counsel xdg advice
xref project eieio eieio-core cl-macs eieio-loaddefs dired
dired-loaddefs compile comint ansi-color swiper cl-seq cl-extra
help-mode easymenu seq byte-opt gv bytecomp byte-compile cconv ivy
delsel ring ivy-faces ivy-overlay colir color 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 lcms2 dynamic-setting system-font-setting font-render-setting
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 3591911 2541685)
 (symbols 48 87049 452)
 (strings 32 528119 452566)
 (string-bytes 1 30189681)
 (vectors 16 217149)
 (vector-slots 8 3232842 6057920)
 (floats 8 1637 5252)
 (intervals 56 501483 50429)
 (buffers 992 581))




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Madhu <enometh@HIDDEN>
Subject: bug#43395: Acknowledgement (28.0.50; memory leak)
Message-ID: <handler.43395.B.160006177529202.ack <at> debbugs.gnu.org>
References: <m34ko3215x.fsf@HIDDEN>
X-Gnu-PR-Message: ack 43395
X-Gnu-PR-Package: emacs
Reply-To: 43395 <at> debbugs.gnu.org
Date: Mon, 14 Sep 2020 05:37:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 43395 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
43395: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43395
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 14 Sep 2020 15:00:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 14 11:00:02 2020
Received: from localhost ([127.0.0.1]:55783 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kHpxZ-0008UO-Kj
	for submit <at> debbugs.gnu.org; Mon, 14 Sep 2020 11:00:01 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56448)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kHpxY-0008Tm-60
 for control <at> debbugs.gnu.org; Mon, 14 Sep 2020 11:00:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53578)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>) id 1kHpxR-0006hl-Sa
 for control <at> debbugs.gnu.org; Mon, 14 Sep 2020 10:59:53 -0400
Received: from [176.228.60.248] (port=2306 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1kHpxQ-000325-Nn
 for control <at> debbugs.gnu.org; Mon, 14 Sep 2020 10:59:53 -0400
Date: Mon, 14 Sep 2020 17:59:57 +0300
Message-Id: <83zh5s9zf6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87r1r5428d.fsf@HIDDEN> (message from Michael Heerdegen on Mon,
 14 Sep 2020 02:43:30 +0200)
Subject: Re: bug#43389: 28.0.50; Emacs memory leaks
References: <87r1r5428d.fsf@HIDDEN>
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

merge 43389 43395
thanks




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: 28.0.50; memory leak
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 14 Sep 2020 15:09:02 +0000
Resent-Message-ID: <handler.43395.B43395.16000961139750 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Madhu <enometh@HIDDEN>
Cc: 43395 <at> debbugs.gnu.org
Received: via spool by 43395-submit <at> debbugs.gnu.org id=B43395.16000961139750
          (code B ref 43395); Mon, 14 Sep 2020 15:09:02 +0000
Received: (at 43395) by debbugs.gnu.org; 14 Sep 2020 15:08:33 +0000
Received: from localhost ([127.0.0.1]:55862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kHq5p-0002XC-5r
	for submit <at> debbugs.gnu.org; Mon, 14 Sep 2020 11:08:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kHq5n-0002Wy-Pd
 for 43395 <at> debbugs.gnu.org; Mon, 14 Sep 2020 11:08:32 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53767)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kHq5g-0000Mj-Aq; Mon, 14 Sep 2020 11:08:25 -0400
Received: from [176.228.60.248] (port=2853 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kHq5d-0003HK-UL; Mon, 14 Sep 2020 11:08:22 -0400
Date: Mon, 14 Sep 2020 18:08:26 +0300
Message-Id: <83y2lc9z11.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <m34ko3215x.fsf@HIDDEN> (message from Madhu on
 Sat, 12 Sep 2020 07:42:42 +0530)
References: <m34ko3215x.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Madhu <enometh@HIDDEN>
> Date: Sat, 12 Sep 2020 07:42:42 +0530
> 
> There appears to be a memory leak with emacs RSS growing inordinately in
> size.
> 
> $ ps o pid,rss,drs,sz,share,start_time,vsize,cmd 26285
>   PID   RSS   DRS  SIZE - START    VSZ CMD
> 26285 2643236 2996379 2664940 - Sep09 2998948 /7/gtk/emacs/build-xt-xft/src/emacs --debug-init --daemon
> 
> I usually only notice the leak when it has gone beyond 2G - when linux
> refuses to suspend because I have limited swap.  In most cases emacs
> would be running for a few days.
> 
> The values reported by garbage-collect amount do not reflect the 2GB
> allocation being used by emacs.

Is the GC report below, collected by report-emacs-bug, from the
session whose RSS has grown up to 2GB?  If not, can you post the
output from garbage-collect in that session?

Thanks.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: 28.0.50; memory leak
Resent-From: Madhu <enometh@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 15 Sep 2020 01:24:02 +0000
Resent-Message-ID: <handler.43395.B43395.160013299630760 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: eliz@HIDDEN
Cc: 43395 <at> debbugs.gnu.org
Received: via spool by 43395-submit <at> debbugs.gnu.org id=B43395.160013299630760
          (code B ref 43395); Tue, 15 Sep 2020 01:24:02 +0000
Received: (at 43395) by debbugs.gnu.org; 15 Sep 2020 01:23:16 +0000
Received: from localhost ([127.0.0.1]:56721 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kHzgi-000804-7Z
	for submit <at> debbugs.gnu.org; Mon, 14 Sep 2020 21:23:16 -0400
Received: from smtp6.ctinetworks.com ([205.166.61.199]:33874)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <enometh@HIDDEN>) id 1kHzgf-0007zu-0j
 for 43395 <at> debbugs.gnu.org; Mon, 14 Sep 2020 21:23:14 -0400
Received: from localhost (unknown [117.193.1.249])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 (Authenticated sender: enometh@HIDDEN)
 by smtp6.ctinetworks.com (Postfix) with ESMTPSA id 2240284401;
 Mon, 14 Sep 2020 21:23:05 -0400 (EDT)
Date: Tue, 15 Sep 2020 06:53:00 +0530 (IST)
Message-Id: <20200915.065300.334588093225206490.enometh@HIDDEN>
From: Madhu <enometh@HIDDEN>
In-Reply-To: <83y2lc9z11.fsf@HIDDEN>
References: <m34ko3215x.fsf@HIDDEN> <83y2lc9z11.fsf@HIDDEN>
X-Mailer: Mew version 6.8 on Emacs 28.0
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-ctinetworks-Information: Please contact the ISP for more information
X-ctinetworks-MailScanner-ID: 2240284401.A276C
X-ctinetworks-VirusCheck: Found to be clean
X-ctinetworks-SpamCheck: 
X-ctinetworks-Watermark: 1600996992.08822@4bNBu0D2PMp9AgpyXeqbLg
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

*  Eli Zaretskii <eliz@HIDDEN> <83y2lc9z11.fsf@HIDDEN>
Wrote on Mon, 14 Sep 2020 18:08:26 +0300
> Is the GC report below, collected by report-emacs-bug, from the
> session whose RSS has grown up to 2GB?  If not, can you post the
> output from garbage-collect in that session?

Yes it is from the same offending session and was collected by
report-emacs-bug. (that session is now long gone, "pining for the
fjords")





Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 9 Oct 2020 06:58:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 09 02:58:45 2020
Received: from localhost ([127.0.0.1]:33984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kQmMX-00076i-6I
	for submit <at> debbugs.gnu.org; Fri, 09 Oct 2020 02:58:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51442)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1kQmMS-00076Q-Ra; Fri, 09 Oct 2020 02:58:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54365)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kQmMN-0002ng-HI; Fri, 09 Oct 2020 02:58:35 -0400
Received: from [176.228.60.248] (port=1210 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kQmME-0004GS-SS; Fri, 09 Oct 2020 02:58:29 -0400
Date: Fri, 09 Oct 2020 09:58:24 +0300
Message-Id: <831ri77unj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Naveed Chehrazi <nchehrazi@HIDDEN>
In-Reply-To: <CADkdQW9aF=yGhYxA=M176wrBw+UMjD+kr7UfcHFWnvQGe5-noQ@HIDDEN>
 (message from Naveed Chehrazi on Thu, 8 Oct 2020 19:53:02 -0500)
Subject: Re: bug#43876: Emacs uses excessive memory
References: <CADkdQW9aF=yGhYxA=M176wrBw+UMjD+kr7UfcHFWnvQGe5-noQ@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
Cc: 43876 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

merge 43876 43389
thanks

> From: Naveed Chehrazi <nchehrazi@HIDDEN>
> Date: Thu, 8 Oct 2020 19:53:02 -0500
> 
> I had two instances where my emacs was using an excessive amount of memory (once about 45GiB, and
> once using 94GiB). I have the memory-profiler report below. It appears that helm package is the cause,

Please disregard the profiler results: it doesn't measure memory
consumption, not at all.

What would be beneficial for this and similar bug reports (see
bug#43389) is to describe what you are doing when memory footprint of
the Emacs process grows significantly.  That might give some ideas
about where to look for the culprit(s).

Do you have some customizations that change gc-cons-threshold?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: memory leaks
Resent-From: Jean Louis <bugs@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 10 Nov 2020 14:25:02 +0000
Resent-Message-ID: <handler.43395.B43395.160501826114652 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Madhu <enometh@HIDDEN>
Cc: 43395 <at> debbugs.gnu.org
Received: via spool by 43395-submit <at> debbugs.gnu.org id=B43395.160501826114652
          (code B ref 43395); Tue, 10 Nov 2020 14:25:02 +0000
Received: (at 43395) by debbugs.gnu.org; 10 Nov 2020 14:24:21 +0000
Received: from localhost ([127.0.0.1]:36870 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kcUZJ-0003oG-Fe
	for submit <at> debbugs.gnu.org; Tue, 10 Nov 2020 09:24:21 -0500
Received: from static.rcdrun.com ([95.85.24.50]:34341)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bugs@HIDDEN>) id 1kcUZI-0003o9-7b
 for 43395 <at> debbugs.gnu.org; Tue, 10 Nov 2020 09:24:20 -0500
Received: from localhost ([::ffff:197.157.34.177])
 (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384)
 by static.rcdrun.com with ESMTPSA
 id 00000000002C0003.000000005FAAA292.00004EC1; Tue, 10 Nov 2020 14:24:18 +0000
Date: Tue, 10 Nov 2020 17:22:46 +0300
From: Jean Louis <bugs@HIDDEN>
Message-ID: <X6qiNtcJmPGQNLMg@HIDDEN>
References: <m3y2ja9f6f.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
In-Reply-To: <m3y2ja9f6f.fsf@HIDDEN>
User-Agent: Mutt/2.0 (3d08634) (2020-11-07)
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* Madhu <enometh@HIDDEN> [2020-11-10 04:27]:
> [Test case follows. Sorry Drew for trying to post to help-gnu and
> debbugs simultaneously, but this is my third attempt at sending this
> test case - I've tried sending it to debbugs.gnu.org and to
> gmane.emacs.help newsgroup - and my messages have been dropped]
> 
> 
> * Madhu <m35z8gise6.fsf@HIDDEN> :
> Wrote on Mon, 14 Sep 2020 15:36:57 +0530:
> > The numbers I reported by garbage-collect do not account for the memory
> > usage. FWIW I've posted that info again at
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43395
> 
> I found test case for this bug and I sent mail to 43395 <at> debbugs.gnu.org,
> and qmail told me that the mail was accepted:
> delivery 1: success:
> 209.51.188.43_accepted_message./Remote_host_said:_250_OK_id=1kc8Bf-00061T-3u/
> But the bugreport didn't show up on gnu.emacs.bug.
> 
> Here is the test case:
> 
> #+BEGIN_SRC
> $ cat > f.c
> #include <stdio.h>
> int
> main()
> {
>   char c = ' ';
>   while (c != 'q' && c != 'Q')
>     {
>       fprintf(stdout, "Press q then enter to quit: ");
>       c = fgetc(stdin);
>     }
>   return 0;
> }
> ^D
> 
> $ gcc f.c
> $ emacs -Q
> #+END_SRC
> 
> M-x shell-command ./a.out
> 
> Then the process hangs. But Emacs' memory grows unbounded.
> 
> WARNING. Be careful to interrupt it with ^G before the OOM killer
> kicks in.  If you have swap you may lose control of your machine
> indefinitely.
> 
> After you interrupt the sub process, Emacs is left with unreclaimed
> gigabytes of RSS
> 
> Please let me know if you can reproduce this

Me I have been testing now. It all blocks. Then I had to switch to
console from X to kill process.

I can see memory is not reclaimed graphically. Not practically. I have
graphical indicator.

This same things happens from time to time in Emacs. Exactly like you
say when I have swap I may lose control of machine. Then I had to
power off with the hard key. Bad.

I hope this can be resolved.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: memory leaks
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 10 Nov 2020 15:29:02 +0000
Resent-Message-ID: <handler.43395.B43395.160502209522566 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Jean Louis <bugs@HIDDEN>
Cc: enometh@HIDDEN, 43395 <at> debbugs.gnu.org
Received: via spool by 43395-submit <at> debbugs.gnu.org id=B43395.160502209522566
          (code B ref 43395); Tue, 10 Nov 2020 15:29:02 +0000
Received: (at 43395) by debbugs.gnu.org; 10 Nov 2020 15:28:15 +0000
Received: from localhost ([127.0.0.1]:38664 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kcVZ8-0005ru-LK
	for submit <at> debbugs.gnu.org; Tue, 10 Nov 2020 10:28:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50806)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kcVZ6-0005rh-Se
 for 43395 <at> debbugs.gnu.org; Tue, 10 Nov 2020 10:28:13 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34381)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kcVZ1-0008Je-3L; Tue, 10 Nov 2020 10:28:07 -0500
Received: from [176.228.60.248] (port=4077 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kcVYy-0008Qb-2u; Tue, 10 Nov 2020 10:28:06 -0500
Date: Tue, 10 Nov 2020 17:28:13 +0200
Message-Id: <83k0ut2pv6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <X6qiNtcJmPGQNLMg@HIDDEN> (message from Jean Louis
 on Tue, 10 Nov 2020 17:22:46 +0300)
References: <m3y2ja9f6f.fsf@HIDDEN>
 <X6qiNtcJmPGQNLMg@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 10 Nov 2020 17:22:46 +0300
> From: Jean Louis <bugs@HIDDEN>
> Cc: 43395 <at> debbugs.gnu.org
> 
> > #+BEGIN_SRC
> > $ cat > f.c
> > #include <stdio.h>
> > int
> > main()
> > {
> >   char c = ' ';
> >   while (c != 'q' && c != 'Q')
> >     {
> >       fprintf(stdout, "Press q then enter to quit: ");
> >       c = fgetc(stdin);
> >     }
> >   return 0;
> > }
> > ^D
> > 
> > $ gcc f.c
> > $ emacs -Q
> > #+END_SRC
> > 
> > M-x shell-command ./a.out
> > 
> > Then the process hangs. But Emacs' memory grows unbounded.

This is expected, and is not a bug.

'shell-command' is intended for running non-interactive programs,
those which produce output, but don't expect any input.  So it runs
the sub-process with its standard input connected to the null device.
Your program has a bug in that case: it doesn't detect the EOF
condition on its standard input (to see that, invoke it as
"./a.out < /dev/null").  So it loops indefinitely, with each iteration
pumping the prompts into Emacs, which obediently collects that in a
buffer, that grows and grows and grows, until it eats up all the
available memory.  And evidently, you didn't configure your system to
have resident size limitation on user processes, so instead of
reporting "memory full", Emacs is allowed to eat up all your memory
and swap.

In short: don't do that.

I see no bug here: Emacs cannot know in advance how much stuff will be
emitted by the sub-process, and it cannot know how much memory it cqan
swallow before OOMK will sporing into action.

And, of course, this is unrelated to the problems being discussed in
this bug report.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: memory leaks
Resent-From: Jean Louis <bugs@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 10 Nov 2020 19:41:01 +0000
Resent-Message-ID: <handler.43395.B43395.160503724523075 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: enometh@HIDDEN, 43395 <at> debbugs.gnu.org
Received: via spool by 43395-submit <at> debbugs.gnu.org id=B43395.160503724523075
          (code B ref 43395); Tue, 10 Nov 2020 19:41:01 +0000
Received: (at 43395) by debbugs.gnu.org; 10 Nov 2020 19:40:45 +0000
Received: from localhost ([127.0.0.1]:38933 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kcZVU-000606-MJ
	for submit <at> debbugs.gnu.org; Tue, 10 Nov 2020 14:40:44 -0500
Received: from static.rcdrun.com ([95.85.24.50]:49783)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bugs@HIDDEN>) id 1kcZVT-0005zj-3J
 for 43395 <at> debbugs.gnu.org; Tue, 10 Nov 2020 14:40:43 -0500
Received: from localhost ([::ffff:197.157.34.177])
 (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384)
 by static.rcdrun.com with ESMTPSA
 id 00000000002C000B.000000005FAAECBA.00000AAF; Tue, 10 Nov 2020 19:40:41 +0000
Date: Tue, 10 Nov 2020 22:40:23 +0300
From: Jean Louis <bugs@HIDDEN>
Message-ID: <X6rspwYMplsZZAin@HIDDEN>
References: <m3y2ja9f6f.fsf@HIDDEN>
 <X6qiNtcJmPGQNLMg@HIDDEN> <83k0ut2pv6.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
In-Reply-To: <83k0ut2pv6.fsf@HIDDEN>
User-Agent: Mutt/2.0 (3d08634) (2020-11-07)
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* Eli Zaretskii <eliz@HIDDEN> [2020-11-10 18:28]:
> > > M-x shell-command ./a.out
> > > 
> > > Then the process hangs. But Emacs' memory grows unbounded.
> 
> This is expected, and is not a bug.
> 
> 'shell-command' is intended for running non-interactive programs,
> those which produce output, but don't expect any input.  So it runs
> the sub-process with its standard input connected to the null device.
> Your program has a bug in that case: it doesn't detect the EOF
> condition on its standard input (to see that, invoke it as
> "./a.out < /dev/null").  So it loops indefinitely, with each iteration
> pumping the prompts into Emacs, which obediently collects that in a
> buffer, that grows and grows and grows, until it eats up all the
> available memory.  And evidently, you didn't configure your system to
> have resident size limitation on user processes, so instead of
> reporting "memory full", Emacs is allowed to eat up all your memory
> and swap.

Thank you, it helps!

Do I need to use `ulimit -m'?

I guess following should be for 1 GiB:
ulimit -m 1048576

and this for 2 GiB:
ulimit -m 2097152

Now I can execute ./a.out without getting blocked in Emacs. I will see
how to tweak that more.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43395: memory leaks
Resent-From: Madhu <enometh@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 10 Nov 2020 20:30:03 +0000
Resent-Message-ID: <handler.43395.B43395.160504019911634 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43395
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: eliz@HIDDEN
Cc: 43395 <at> debbugs.gnu.org, bugs@HIDDEN
Received: via spool by 43395-submit <at> debbugs.gnu.org id=B43395.160504019911634
          (code B ref 43395); Tue, 10 Nov 2020 20:30:03 +0000
Received: (at 43395) by debbugs.gnu.org; 10 Nov 2020 20:29:59 +0000
Received: from localhost ([127.0.0.1]:39044 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kcaH8-00031Z-S2
	for submit <at> debbugs.gnu.org; Tue, 10 Nov 2020 15:29:59 -0500
Received: from smtp5.ctinetworks.com ([205.166.61.198]:46450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <enometh@HIDDEN>) id 1kcaH7-00031R-Gx
 for 43395 <at> debbugs.gnu.org; Tue, 10 Nov 2020 15:29:57 -0500
Received: from localhost (unknown [117.193.7.162])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 (Authenticated sender: enometh@HIDDEN)
 by smtp5.ctinetworks.com (Postfix) with ESMTPSA id 7B5F7164A84;
 Tue, 10 Nov 2020 15:29:45 -0500 (EST)
Date: Wed, 11 Nov 2020 01:59:10 +0530 (IST)
Message-Id: <20201111.015910.29255552927667096.enometh@HIDDEN>
From: Madhu <enometh@HIDDEN>
In-Reply-To: <83k0ut2pv6.fsf@HIDDEN>
References: <m3y2ja9f6f.fsf@HIDDEN>
 <X6qiNtcJmPGQNLMg@HIDDEN> <83k0ut2pv6.fsf@HIDDEN>
X-Mailer: Mew version 6.8 on Emacs 28.0
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-ctinetworks-Information: Please contact the ISP for more information
X-ctinetworks-MailScanner-ID: 7B5F7164A84.A3883
X-ctinetworks-VirusCheck: Found to be clean
X-ctinetworks-SpamCheck: 
X-ctinetworks-Watermark: 1605904196.66279@ITe7GQPO+2q0f735lin5CA
X-Spam-Score: 1.5 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: * Eli Zaretskii <eliz@HIDDEN> <83k0ut2pv6.fsf@HIDDEN> Wrote
 on Tue, 10 Nov 2020 17:28:13 +0200 > This is expected, and is not a bug.
 > > 'shell-command' is intended for running non-interactive programs, > those
 which produce output, but don't expect any input. So it runs > the sub-process
 with [...] 
 Content analysis details:   (1.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
 [117.193.7.162 listed in dnsbl.sorbs.net]
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)

*  Eli Zaretskii <eliz@HIDDEN> <83k0ut2pv6.fsf@HIDDEN>
Wrote on Tue, 10 Nov 2020 17:28:13 +0200

> This is expected, and is not a bug.
>
> 'shell-command' is intended for running non-interactive programs,
> those which produce output, but don't expect any input.  So it runs
> the sub-process with its standard input connected to the null device.
> Your program has a bug in that case: it doesn't detect the EOF
> condition on its standard input (to see that, invoke it as
> "./a.out < /dev/null").  So it loops indefinitely, with each iteration
> pumping the prompts into Emacs, which obediently collects that in a
> buffer, that grows and grows and grows, until it eats up all the
> available memory.  And evidently, you didn't configure your system to
> have resident size limitation on user processes, so instead of
> reporting "memory full", Emacs is allowed to eat up all your memory
> and swap.
>
> In short: don't do that.
>
> I see no bug here: Emacs cannot know in advance how much stuff will be
> emitted by the sub-process, and it cannot know how much memory it cqan
> swallow before OOMK will sporing into action.
>
> And, of course, this is unrelated to the problems being discussed in
> this bug report.

Sorry, yes - the memory is indeed freed up when *Shell Command Output*
is killed.  I was mistaken in thinking that the memory was not freed
up when all the buffers had been deleted.

Apologies.




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 16 Nov 2020 20:23:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 16 15:23:29 2020
Received: from localhost ([127.0.0.1]:57440 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kel29-0006xc-B5
	for submit <at> debbugs.gnu.org; Mon, 16 Nov 2020 15:23:29 -0500
Received: from eggs.gnu.org ([209.51.188.92]:41192)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kel27-0006xQ-O1
 for control <at> debbugs.gnu.org; Mon, 16 Nov 2020 15:23:28 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:41327)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>) id 1kel22-0004G5-7U
 for control <at> debbugs.gnu.org; Mon, 16 Nov 2020 15:23:22 -0500
Received: from [176.228.60.248] (port=2025 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1kel21-0005W2-Gs
 for control <at> debbugs.gnu.org; Mon, 16 Nov 2020 15:23:22 -0500
Date: Mon, 16 Nov 2020 22:23:15 +0200
Message-Id: <835z65rqz0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: control <at> debbugs.gnu.org (GNU bug tracker automated control server)
In-Reply-To: <handler.s.C.160555785426128.transcript <at> debbugs.gnu.org>
 (control <at> debbugs.gnu.org)
Subject: Re: Processed (with 1 errors): Re: bug#44666: 28.0.50;
 malloc-info: Emacs became not responsive, using hard disk all time
References: <837dqlrr8z.fsf@HIDDEN>
 <handler.s.C.160555785426128.transcript <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

severity 44666 normal
merge 44666 43389
thanks





Last modified: Mon, 16 Nov 2020 20:30:02 UTC

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