GNU bug report logs - #43395
28.0.50; memory leak

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Mon, 14 Sep 2020 05:37:01 UTC

Severity: normal

Merged with 43389, 43876, 44666

Found in version 28.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Jean Louis <bugs <at> gnu.support>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: enometh <at> meer.net, 43395 <at> debbugs.gnu.org
Subject: Re: bug#43395: memory leaks
Date: Tue, 10 Nov 2020 22:40:23 +0300
* Eli Zaretskii <eliz <at> gnu.org> [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.





This bug report was last modified 4 years and 58 days ago.

Previous Next


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