lies, damn lies and erlang memory use

Rickard Green rickard.green@REDACTED
Mon Oct 21 15:52:03 CEST 2002


Hi,

Matthias Lang wrote:
>


> 
> (Yes, you detect my tone of doubt, which is provoked by there being
> many different BIFs and things for reporting on Erlang memory use, but
> it's not very obvious which ones refer to what. They also seem to lie
> quite a bit, for instance:
> 
>   - c:memory().
> 
>       Looks suspect; it's "total" is always much less than
>       the sum of the parts it reports, e.g. on x86 linux:
> 
>       Eshell V5.1.2  (abort with ^G)
>       1> c:memory().
>       [{total,2109082},
>       {processes,181236},
>       {system,1927846},
>       {atom,180221},
>       {atom_used,150362},
>       {binary,96064},
>       {code,1156376},
>       {ets,72948}]
> 

total = processes + system
system = atom + binary + code + ets + <other>
atom = atom_used + <atom_not_used>
<real_total> = processes + <real_system>
<real_system> = system + <blocks_we_missed>

(things inside <> are not part of the result returned by c:memory())

See the c(3) man page.

Note, c:memory() tries to give you an answer to how much memory the
emulator have allocated which is not the same as the total size of all
mapped pages.

> 
> 


Regards,
Rickard Green (Erlang/OTP)



More information about the erlang-questions mailing list