[rabbitmq-discuss] Memory Usage in Management API

Simon MacMullen simon at rabbitmq.com
Fri May 2 09:21:43 BST 2014


These are rather general questions, so it would help a great deal if I 
knew what you were trying to do.

On 02/05/2014 08:54, Arun Rao wrote:
> Can someone please clarify the following:
>
> 1. Memory Usage (by node) shown in Management API: Sum of
> total_heap_size of all registered processes (including
> rabbit_mgmt_agent_sup, rabbit_mgmt_sup etc.,)?

The memory use per node is that reported by erlang:memory(total). This 
includes all processes, registered and unregistered as well as all 
binaries, atoms, ETS tables, code and so on. It's supposed to correspond 
to how much memory is used at the OS level. Sadly in practice it doesn't 
take account of memory fragmentation so it can differ, but it's the 
closest thing Erlang gives us.

> 2. Where does virtual hosts/exchanges/queues live? Everything related to
> rabbitmq amqp server functionality is on "rabbit" erlang process?

No, not at all. That process is the top of the tree but there are many 
others. All the objects (i.e. vhosts, exchanges, queues and so on) exist 
as records in Mnesia / ETS tables, and queues also exist as processes.

> 3. Has anyone had success with erlang:trace? I am trying the following
> but couldnt get this to work:
>
> rabbitmqctl eval
> 'PID=erlang:whereis(rabbit),erlang:trace(PID,gc_start,info).'

Well, the second argument to trace/3 is a boolean, and the third is a 
list of flags, of which 'info' is not one. But trace/3 is very low 
level. You probably want to use the debugger instead?

Cheers, Simon


More information about the rabbitmq-discuss mailing list