Subject: Re: bug#54698: non-recursive GC marking [PATCH]

From: Po Lu <[email-masked]>
Date: Fri, 08 Apr 2022 20:16:27 +0800

Lars Ingebrigtsen <[email-masked]> writes:

> Users will see mysterious segfaults that they didn't see before
> throughout the system.  Using the default settings (which, after all,
> almost everybody does), you can ask the system for virtually infinite
> amounts of memory, and the system will say "OK", and if you only use a
> tiny bit of that, everything will be fine.

With the default settings (0), you cannot ask the system for an infinite
amount of memory.  The kernel will reject deliberate overcommits of
memory, but will let programs like Emacs slowly run out of memory until
they are killed.  There is some guessing involved, and that guessing can
become unpredictable, leading to behavior like what Richard saw.

> With your recommended settings, programs like that will segfault
> instead.

Those programs which ask for huge amounts of heap and do not check the
return value of malloc will crash anyway under the default kernel
setting, which is why they don't exist.

> It's the height of hubris as Emacs developers to recommend OS-wide
> settings on something like this, and it makes us look like amateurs.

Overcommit is very controversial among even the Linux developers,
because it works well for some programs and does not for others.

IMO, it is reasonable to recommend the option that works best for us,
which is to turn overcommit off.

Thanks.