Mnesia, table updates, and (UNIX) process bloat

Scott Lystig Fritchie <>
Fri Apr 7 04:59:11 CEST 2006


In a followup to my own message ... I have a plea for the Gods of the
virtual machine.

Assume that I start the VM with "+Mim true" to get the memory
instrumentation enabled.  Then assume I call the following function
and see this result:

    erlang:system_info({allocator, binary_alloc}) ==>
        [...
         {mbcs,[{blocks,5609521,5617526,5617526},
                {blocks_size,646515824,674100920,674100920},
                {carriers,135,137,137},
                {mseg_alloc_carriers,134},
                {sys_alloc_carriers,1},
                {carriers_size,679624744,690110504,690110504},
                {mseg_alloc_carriers_size,679493632},
                {sys_alloc_carriers_size,131112}]},
        ...]

As far as I can tell (without actually looking at source code to
verify ... ):

    'blocks' = number of items allocated out of this "carrier"
        (to use the names from the "erts_alloc" document).

        Each item is an individual binary term?  Larger than 64 bytes
        and thus allocated using the binary_alloc allocator?

    'blocks_size' = sum of the size of each 'blocks' item.  Perhaps
        plus a little extra fudge/overhead/alignment?

    'carriers_size' = sum of all memory region sizes allocated for
        this carrier

OK, if those guesses are correct ... then if I see the 'blocks' and
'blocks_size' values increasing without an eventual decrease(*)
then I definitely have some >64 byte binary
term somewhere that's still referenced, right?

(*) Presumably due to garbage collection.

-Scott



More information about the erlang-questions mailing list