mnesia memory usage on 32 and 64 bits machines

Brian Candler <>
Sat Jan 1 17:34:02 CET 2011


On Fri, Dec 31, 2010 at 12:46:02PM +0100, franz wrote:
> I would like to know your opinions about a load test I'm doing,
> whose result quite shocked me.
> Briefly, I created a mnesia ets table and inserted 50000 records into it.
> I tried this bulk load on two machines: the first, say it A, running
> a 64bits kernel on a 64 bits machine, the second, say it B, running
> a 32bits kernel on a 64 bits machine.
> On A the records occupy 202707450 words of mem, and misuring the RAM
> consumption before and after the insertion I know that they occupy
> 1560Mb.
> On B the records occupy 202707473 words of mem, with a RAM
> consumption of 795Mb.
> On one hand this makes sense, because as far as I know a word of mem
> on a 32bits machine is 4 bytes, 8 on a 64bits machine. But does this
> mean that having a 64 bits kernel doubles the memory usage?!?

When you boot a 32-bit kernel, your processor is running in a
backwards-compatibility 32-bit mode, as an i386 processor.  The x86_64 mode
is essentially a different processor, with different instruction set and
register model.

And if you boot into DOS, you'll be running 16-bit "real mode" :-)

But in summary: booting a 32-bit OS turns your machine into a 32-bit PC.

Regards,

Brian.


More information about the erlang-questions mailing list