Subject: bug#31091: 25.2: Feature Request: auto exit upon memory exhaustion warning

From: Noam Postavsky <[email-masked]>
Date: Sun, 08 Apr 2018 12:30:27 -0400

Boruch Baum <[email-masked]> writes:

> On 2018-04-08 11:27, Noam Postavsky wrote:
>> Boruch Baum <[email-masked]> 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.