[erlang-questions] eheap_alloc crash when using mnesia

Jacob Perkins japerk@REDACTED
Tue Oct 21 00:24:49 CEST 2008

I used to get those eheap out-of-memory crashes a lot. The way to fix it is
to ruthlessly minimize the records you store in mnesia. I've found that
mnesia works best with very small records, and if you're doing iteration on
the table, then do it in small chunks at a time without accumulating a large
structure (use select instead of match_object if you expect to get a large
number of records).

I had been storing dicts in mnesia, and running into memory issues, until
members of this list pointed me to the idea of using ordered_set tables with
tuples keys. That allowed me to separate the dict into small records while
still maintaining iteration & matching performance requirements. The number
of records in a table has gone up dramatically, but that doesn't seem to
cause any problems.

Hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081020/740878fd/attachment.htm>

More information about the erlang-questions mailing list