memory used by Erlang VM

Vyacheslav Levytskyy v.levytskyy@REDACTED
Fri Jan 31 19:21:46 CET 2020


Hello,

I wonder why memory used by Erlang VM as reported by the kernel via the 
/proc/pid differs from erlang:memory(total). In my current configuration 
I observe realistic response from erlang:memory(total) and much lower 
values from the /proc/pid.

I'm not surprised by the difference itself, but rather by the fact that 
the /proc/pid gives unrealistically lower values -- I'm not 100% sure, 
but it looks like RabbitMQ is using the /proc/pid approach by default, 
proposing also recon_alloc:memory(allocated) and erlang:memory(total) as 
available options of Erlang VM memory consumption calculation strategy.

Does anybody have insights of what and why is going on with those 
calculations of memory used by Erlang VM? Is it possible to select one 
strategy beforehand for my Erlang app, or I must measure on each new 
configuration what looks more precise? Should I compare and change the 
strategy during run-time, or after I selected a strategy once for my 
configuration I can be sure that selected approach always better than 
other two?

Thank you,
Vyacheslav



More information about the erlang-questions mailing list