[erlang-questions] Reading disc_copies table into memory upon starting mnesia

Kenneth Lundin <>
Fri Jan 22 11:56:09 CET 2010


Hi,

As already answered by Dan disc_copies means storing the table inram
but with copy on disc.
If you mean that the tables take 20MB on disc but blows up to 500MB in
RAM I think that
seems strange. What kind of data do you have in that case? And are you
running a 64 bit system?
Having strings as lists can give an expansion from the external format
(used on disc) to
the internal format by a factor of 16. But there are other datatypes
like atoms which
are more compact in the internal format than in the external.

By changing strings from lists to binaries you can avoid the expansion
, they will take similar space
in extenal and internal representation.

/Kenneth Erlang/OTP Ericsson

On Fri, Jan 22, 2010 at 8:53 AM, Yogish Baliga <> wrote:
> Hello all,
>
>  Recently I noticed that disc_copies will try to read everything from the table into memory during startup. Even though the table size is around 20MB, memory consumed is around 500MB. As the size of the table increases, there is a high chance that it is not possible to start mnesia anymore as all memory is consumed by mnesia disc_copies table and before it could successfully start, VM crashes.
>
>  Is there any plan to re-implement disc_copies table without reading whole table into memory, instead read only partial data into memory. And also to specify the max. memory that can be allocated for mnesia tables [as in MySQL innodb_buffer_pool_size parameter].
>
> -- baliga
>
>
> "Point of view is worth 80 IQ points" --Alan Kay
>
> http://dudefrommangalore.blogspot.com/


More information about the erlang-questions mailing list