[erlang-questions] eheap_alloc crash when using mnesia

Matthew Dempsky <>
Wed Oct 22 20:28:22 CEST 2008


On Wed, Oct 22, 2008 at 1:33 AM, Robert Raschke <> wrote:
> Are you sure that uses plain old memory allocation for its cache
> entries (I haven't looked, I must admit)?

Yes, I chose dnscache as a concrete example because it's a server
whose internals I'm thoroughly familiar with. :-)

dnscache allocates a big chunk of memory (1000000 bytes by default) up
front for cache storage, but while processing requests, it allocates
additional memory for temporary storage for names relevant to the
resolution process.

E.g., if a cache receives a query for "www.erlang.org", it allocate 16
bytes to store that name.  While resolving this query, it also
allocates temporary space for "a.root-servers.net",
"d0.org.afilias-nst.org", "ns.erlang.org", and so on.  Names are
promptly freed as soon as they are no longer needed, but if allocating
space for one of these names fails, then dnscache gives up on
resolving "www.erlang.org" and the user tries again later.



More information about the erlang-questions mailing list