[erlang-questions] Relationship between erlang:memory/1, ets:info/2 and erlang:process_info/2
Sat Sep 22 10:18:35 CEST 2012
There could be even more inconsistensies between memory consumed by
erlang vm and statistics reported by memory().
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15863 root 20 0 721m 559m 3316 S 0 14.1 3:47.58 beam.smp
Total in memory() output is about 100Mb but real memory usage of
erlang vm (R14B04) is ~600Mb
On Fri, Sep 21, 2012 at 8:50 PM, Simon MacMullen <simon@REDACTED> wrote:
> I'm trying to write something that will account for memory use on a RabbitMQ
> system. To do this I'm trying to match up the numbers I get out of
> erlang:memory(ets) and ets:info(T, memory), and erlang:memory(processes) and
> And it doesn't make a huge amount of sense to me. I don't expect things to
> match up perfectly, of course there will be some memory unaccounted for, but
> the ETS numbers in particular can be quite off:
> 1> erlang:memory(ets).
> 2> lists:sum([ets:info(T, memory) || T <- ets:all()]) *
> So I have ~2GB of ETS memory, and ~230MB unaccounted for. Should I expect
> these to match up closer?
> And then...
> 3> erlang:memory(processes).
> 4> lists:sum([element(2, process_info(P, memory)) || P <- processes()]).
> So for processes there is less in total than if you add them all up. Is some
> memory shared? (Are we counting binaries and atoms in there as well?)
> Is there a way to get this sort of information in a more consistent manner?
> Cheers, Simon
> Simon MacMullen
> RabbitMQ, VMware
> erlang-questions mailing list
More information about the erlang-questions