[erlang-questions] eheap_alloc crash when using mnesia

Matthew Dempsky matthew@REDACTED
Thu Oct 23 19:40:19 CEST 2008

On Thu, Oct 23, 2008 at 12:44 AM,  <attila.rajmund.nohl@REDACTED> wrote:
> This works for a stateless protocol like DNS - but what would you do for
> e.g. HTTP?  The correct answer would probably to send an "503 Service
> Unavailable" answer, but that would need more memory and we've just run
> out of memory.

Before accepting a new TCP connection, you allocate enough space to
ensure you can fail correctly.  E.g., the qmail-smtpd program from
qmail handles inbound SMTP connections.  If it runs out of memory
while processing a request, it gives a "420 out of memory" response
using memory allocated when the new connection was first accepted.

> Even abruptly closing the TCP session might need more
> memory to construct the FIN packet.

That's a problem that the kernel needs to handle.

More information about the erlang-questions mailing list