GNU bug report logs - #31091
25.2: Feature Request: auto exit upon memory exhaustion warning

Previous Next

Package: emacs;

Reported by: Boruch Baum <boruch_baum <at> gmx.com>

Date: Sun, 8 Apr 2018 07:23:02 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31091 in the body.
You can then email your comments to 31091 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 07:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Boruch Baum <boruch_baum <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org.

Your message had a Version: pseudo-header with an invalid package version:

emacs 25.2, debian

please either use found or fixed to the control server with a correct version, or reply to this report indicating the correct version so the maintainer (or someone else) can correct it for you.

(Sun, 08 Apr 2018 07:23:02 GMT) Full text and rfc822 format available.


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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Emacs Bug Reporting <bug-gnu-emacs <at> gnu.org>
Subject: 25.2: Feature Request: auto exit upon memory exhaustion warning
Date: Sun, 8 Apr 2018 03:22:23 -0400
Version: emacs 25.2, debian

As emacs begins to exhaust memory, it begins to grind all system process's
performance to a halt, which is clearly undesirable. If the user notices
in time, either because the user is attentive to the mode line or the
system slow-down, then the user will have an opportunity to gracefully
exit and restart emacs, but such is not always the case, and should not
be presumed to always be the case.

I would like to suggest a optional feature to automatically save
buffers and shut down emacs / emacs-server when this condition occurs.
The user could toggle its operation by manipulating a boolean variable.

It's default condition is for the emacs developers to decide. My vote
would be for default on, in the interest of the greater good of
preserving an entire system from grinding to a halt.

I reliably encountered memory exhaustion when testing function
`apropos-value', which creates for me that condition within five
calls.

An alternate solution, external to emacs, would be to use the shell's
`ulimit' feature, but I don't know whether this is available on all
platforms (eg. Microsoft), and would require constant tinkering of the
memory threshold limit to account for any change in requirements in the
sum of all the other system processes.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 07:52:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 09:51:14 +0200
On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> I would like to suggest a optional feature to automatically save
> buffers and shut down emacs / emacs-server when this condition occurs.

How do you detect that condition?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 08:00:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 03:59:21 -0400
On 2018-04-08 09:51, Andreas Schwab wrote:
> How do you detect that condition?

Emacs already monitors the condition, and currently performs the following:

1] Adds a memory warning to the mode line;

2] Warns the user with a minibuffer message, along with the suggestion
to save the current buffer and exit emacs.

The proposed feature request would optionally change that behavior.

-- 
hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 08:37:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 10:36:27 +0200
On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> On 2018-04-08 09:51, Andreas Schwab wrote:
>> How do you detect that condition?
>
> Emacs already monitors the condition, and currently performs the following:

It monitors its virtual memory.  But shortage of physical memory is more
difficult to detect.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 08:47:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 04:46:01 -0400
On 2018-04-08 10:36, Andreas Schwab wrote:
> It monitors its virtual memory.  But shortage of physical memory is more
> difficult to detect.

Virtual memory would be the relevant metric here.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 11:25:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 13:24:05 +0200
On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> On 2018-04-08 10:36, Andreas Schwab wrote:
>> It monitors its virtual memory.  But shortage of physical memory is more
>> difficult to detect.
>
> Virtual memory would be the relevant metric here.

But physical memory will be exhausted long before virtual memory is.
And it may not even be Emacs which exhausted it.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 11:50:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 07:49:37 -0400
On 2018-04-08 13:24, Andreas Schwab wrote:
> But physical memory will be exhausted long before virtual memory is.
> And it may not even be Emacs which exhausted it.

Before you commit to what you wrote, why not try it yourself first; it's
easy to do, and you will see for yourself whether what you wrote is
true. Start from your working copy of emacs, not a test instance, so
that emacs will have accumulated a nice quantity of data to populate its
various system *-ring and *-history variables, and perform apropos-value
on a common string. Repeat as necessary and see for yourself whether
what you say is true.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 12:59:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory exhaustion
 warning
Date: Sun, 08 Apr 2018 15:58:14 +0300
> Date: Sun, 8 Apr 2018 03:22:23 -0400
> From: Boruch Baum <boruch_baum <at> gmx.com>
> 
> I would like to suggest a optional feature to automatically save
> buffers and shut down emacs / emacs-server when this condition occurs.
> The user could toggle its operation by manipulating a boolean variable.

FWIW, I consider automatic shutdown in this case a misfeature, because
this is likely to shut down a session due to some memory-related bugs
more than anything else.  But if others would like that, I won't block
adding it as an opt-in option.

I do agree with Andreas that normally a system will start paging long
before the virtual memory threshold for that warning is exceeded.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 13:22:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 09:21:24 -0400
On 2018-04-08 15:58, Eli Zaretskii wrote:
> FWIW, I consider automatic shutdown in this case a misfeature, because
> this is likely to shut down a session due to some memory-related bugs
> more than anything else.

You would want an emacs bug to bring down your entire system to just
short of a complete freeze (my experience of today / last night)?

>  But if others would like that, I won't block adding it as an opt-in
> option.

> I do agree with Andreas that normally a system will start paging long
> before the virtual memory threshold for that warning is exceeded.

Not my experience today / last night.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 13:26:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 09:25:06 -0400
Boruch Baum <boruch_baum <at> gmx.com> writes:

> As emacs begins to exhaust memory, it begins to grind all system process's
> performance to a halt, which is clearly undesirable. If the user notices
> in time, either because the user is attentive to the mode line or the
> system slow-down, then the user will have an opportunity to gracefully
> exit and restart emacs, but such is not always the case, and should not
> be presumed to always be the case.

If you set the virtual memory limit to 1 or 2 GB (or something
proportional to the amount of physical memory you have) by doing

    ulimit -Sv $((1000 * 1024))

before you start Emacs, instead of allocating until system slow-down,
Emacs should stop with a message:

    Memory exhausted--use C-x s then exit and restart Emacs

Possibly also a warning like

    Emergency (alloc): Warning: past 75% of memory limit

depending on how quickly you approach the limit.

(yes, I've tried this, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26952#18)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 13:55:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 09:53:52 -0400
On 2018-04-08 09:25, Noam Postavsky wrote:
> If you set the virtual memory limit to 1 or 2 GB (or something
> proportional to the amount of physical memory you have) by doing
>
>     ulimit -Sv $((1000 * 1024))
>
> ...

Yes, I mentioned that alternative in the final paragraph of my initial
email. Good to hear that you can report it works; it looks like that
will have to be my work-around until debian packages emacs26. Thanks.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 13:58:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 16:57:46 +0300
> Date: Sun, 8 Apr 2018 09:21:24 -0400
> From: Boruch Baum <boruch_baum <at> gmx.com>
> Cc: 31091 <at> debbugs.gnu.org
> 
> On 2018-04-08 15:58, Eli Zaretskii wrote:
> > FWIW, I consider automatic shutdown in this case a misfeature, because
> > this is likely to shut down a session due to some memory-related bugs
> > more than anything else.
> 
> You would want an emacs bug to bring down your entire system to just
> short of a complete freeze (my experience of today / last night)?

You would want to introduce a new non-trivial feature based on a
single data point, which is a bug that most probably was solved many
moons ago.

> > I do agree with Andreas that normally a system will start paging long
> > before the virtual memory threshold for that warning is exceeded.
> 
> Not my experience today / last night.

You are experiencing a particular nasty bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 15:28:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 11:27:38 -0400
Boruch Baum <boruch_baum <at> gmx.com> writes:

> in time, either because the user is attentive to the mode line or the

>> How do you detect that condition?
>
> Emacs already monitors the condition, and currently performs the following:
>
> 1] Adds a memory warning to the mode line;

I'm not sure what mode line warning you are talking about.  But, as
Andreas says, and can be shown by experimenting with 'ulimit', Emacs
measures usage of virtual memory.  Physical memory usage is subject the
allocation algorithms of the OS, and can't be reliably measured.

So I don't think this feature request can be satisfied.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 15:55:01 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 11:54:32 -0400
On 2018-04-08 11:27, Noam Postavsky wrote:
> Boruch Baum <boruch_baum <at> gmx.com> writes:
> > Emacs already monitors the condition, and currently performs the following:
> >
> > 1] Adds a memory warning to the mode line;
>
> I'm not sure what mode line warning you are talking about.

    mode-line-front-space is a variable defined in ‘bindings.el’.
    Its value is (:eval (if (display-graphic-p) " " "-"))

      This variable may be risky if used as a file-local variable.

    Documentation:
    Mode line construct to put at the front of the mode line.
    By default, this construct is displayed right at the beginning of
    the mode line, except that if there is a memory-full message, it
    is displayed first.

> So I don't think this feature request can be satisfied.

The same logic that currently issues the warning messages would perform
the shutdown if a variable were set.


-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:11:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 18:10:03 +0200
On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> On 2018-04-08 13:24, Andreas Schwab wrote:
>> But physical memory will be exhausted long before virtual memory is.
>> And it may not even be Emacs which exhausted it.
>
> Before you commit to what you wrote, why not try it yourself first;

How is that relevant?  That statement is true for every process.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:14:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: Noam Postavsky <npostavs <at> gmail.com>, 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 18:13:56 +0200
On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> The same logic that currently issues the warning messages would perform
> the shutdown if a variable were set.

That logic cannot predict the shortage of a systemwide shared resource.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:18:02 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 12:17:19 -0400
On 2018-04-08 18:10, Andreas Schwab wrote:
> On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:
>
> > On 2018-04-08 13:24, Andreas Schwab wrote:
> >> But physical memory will be exhausted long before virtual memory is.
> >> And it may not even be Emacs which exhausted it.
> >
> > Before you commit to what you wrote, why not try it yourself first;
>
> How is that relevant?  That statement is true for every process.

It's relevant because its reality, and doing so might force you to
confront a reality at odds with your statements.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:22:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Boruch Baum <boruch_baum <at> gmx.com>, 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 18:21:33 +0200
On Apr 08 2018, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> Not my experience today / last night.
>
> You are experiencing a particular nasty bug.

The only bug is that apropos-value uses a sub-optimal implementation
that produces a lot of data.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:31:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 12:30:27 -0400
Boruch Baum <boruch_baum <at> gmx.com> writes:

> On 2018-04-08 11:27, Noam Postavsky wrote:
>> Boruch Baum <boruch_baum <at> gmx.com> writes:
>> > Emacs already monitors the condition, and currently performs the following:
>> >
>> > 1] Adds a memory warning to the mode line;
>>
>> I'm not sure what mode line warning you are talking about.
>

>     By default, this construct is displayed right at the beginning of
>     the mode line, except that if there is a memory-full message, it
>     is displayed first.

Ah, looks like that warning is non-operational in most configurations though:

    static const char *
    decode_mode_spec (struct window *w, register int c, int field_width,
              Lisp_Object *string)
    {
      [...]
        case 'e':
    #if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC
          {
        if (NILP (Vmemory_full))
          return "";
        else
          return "!MEM FULL! ";
          }
    #else
          return "";
    #endif


>> So I don't think this feature request can be satisfied.
>
> The same logic that currently issues the warning messages would perform
> the shutdown if a variable were set.

Hmm, I guess I'm not sure what advantage an abrubt shutdown has over a
warning.  And as far as I understand, you never saw the warnings
messages, so it wouldn't have helped in your case anyway, since you
didn't hit the virtual memory limit.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:32:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>,
 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 12:31:41 -0400
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> On Apr 08 2018, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>>> Not my experience today / last night.
>>
>> You are experiencing a particular nasty bug.
>
> The only bug is that apropos-value uses a sub-optimal implementation
> that produces a lot of data.

No, it's probably Bug#26952, as I mentioned earlier.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:38:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: boruch_baum <at> gmx.com, 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 19:37:29 +0300
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Boruch Baum <boruch_baum <at> gmx.com>,  31091 <at> debbugs.gnu.org
> Date: Sun, 08 Apr 2018 18:21:33 +0200
> 
> > You are experiencing a particular nasty bug.
> 
> The only bug is that apropos-value uses a sub-optimal implementation
> that produces a lot of data.

No, I meant memory-allocation trouble in Emacs 25.x on some versions
of GNU/Linux.

The same command doesn't get me anywhere near the memory-full
threshold in later versions of Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 16:59:01 GMT) Full text and rfc822 format available.

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

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 8 Apr 2018 12:58:19 -0400
On 2018-04-08 12:30, Noam Postavsky wrote:
> Hmm, I guess I'm not sure what advantage an abrubt shutdown has over a
> warning.

The most useful case would be of a user is running a time-consuming
operation or an asynchronous operation, maybe a long repetitive macro,
for which the current warning would be generated at near the beginning
of the operation and system freeze would happen in mid-operation.

>  And as far as I understand, you never saw the warnings
> messages,

I did see the mini-buffer advice and warning, and ignored it, and I did
see the mode line warning, and ignored it. Added to the long list of
things I've done -- once.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 17:27:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 13:26:08 -0400
Boruch Baum <boruch_baum <at> gmx.com> writes:

> On 2018-04-08 12:30, Noam Postavsky wrote:
>> Hmm, I guess I'm not sure what advantage an abrubt shutdown has over a
>> warning.
>
> The most useful case would be of a user is running a time-consuming
> operation or an asynchronous operation, maybe a long repetitive macro,
> for which the current warning would be generated at near the beginning
> of the operation and system freeze would happen in mid-operation.

The final out-of-memory message comes via `signal', so any operation
would be interrupted.  Although the almost-out-of-memory warnings just
use display-warnings, so they don't interrupt anything.

>>  And as far as I understand, you never saw the warnings
>> messages,
>
> I did see the mini-buffer advice and warning, and ignored it, and I did
> see the mode line warning, and ignored it. Added to the long list of
> things I've done -- once.

Hmm, I'm surprised you actually hit the warning.  Are you on a 32 bit
system with about 4GB RAM?  I guess you could hit the 75% warning at 3GB
allocation, and then start swapping soon after, if other processes are
using about 1GB RAM.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 17:29:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 08 Apr 2018 19:28:20 +0200
On Apr 08 2018, Boruch Baum <boruch_baum <at> gmx.com> wrote:

> It's relevant because its reality, and doing so might force you to
> confront a reality at odds with your statements.

It isn't.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 08 Apr 2018 21:59:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Boruch Baum <boruch_baum <at> gmx.com>, 31091 <at> debbugs.gnu.org
Subject: Re: [OFFLIST] Re: bug#31091: 25.2: Feature Request: auto exit upon
 memory exhaustion warning
Date: Sun, 8 Apr 2018 17:58:34 -0400
On 8 April 2018 at 14:10, Boruch Baum <boruch_baum <at> gmx.com> wrote:
> On 2018-04-08 13:26, Noam Postavsky wrote:
>> Hmm, I'm surprised you actually hit the warning.  Are you on a 32 bit
>> system with about 4GB RAM?  I guess you could hit the 75% warning at 3GB
>> allocation, and then start swapping soon after, if other processes are
>> using about 1GB RAM.
>
> 64-bit 4GB RAM

Huh. I have a similar machine, and I never saw the warning until I
started using ulimit. I can't understand how you hit it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31091; Package emacs. (Sun, 24 Apr 2022 14:27:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Boruch Baum <boruch_baum <at> gmx.com>, 31091 <at> debbugs.gnu.org
Subject: Re: bug#31091: 25.2: Feature Request: auto exit upon memory
 exhaustion warning
Date: Sun, 24 Apr 2022 16:25:57 +0200
Andreas Schwab <schwab <at> linux-m68k.org> writes:

>> I would like to suggest a optional feature to automatically save
>> buffers and shut down emacs / emacs-server when this condition occurs.
>
> How do you detect that condition?

I don't think there's anything generally useful Emacs can do here to
detect the situation -- Emacs can't know whether the machine is running
out of memory one way or another.  (For instance, it may be in a VM and
the host is running out of memory.)

So I don't think there'll be any progress in this bug report, and I'm
therefore closing it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 24 Apr 2022 14:27:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 31091 <at> debbugs.gnu.org and Boruch Baum <boruch_baum <at> gmx.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 24 Apr 2022 14:27:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 23 May 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 333 days ago.

Previous Next


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