summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_vm.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rabbit_vm.erl b/src/rabbit_vm.erl
index ce6c9323a9..b49c0a7cb1 100644
--- a/src/rabbit_vm.erl
+++ b/src/rabbit_vm.erl
@@ -71,7 +71,10 @@ sup_children(Sup) ->
rabbit_misc:with_exit_handler(
rabbit_misc:const([]), fun () -> supervisor:which_children(Sup) end).
-pid_memory(Pid) when is_pid(Pid) -> element(2, process_info(Pid, memory));
+pid_memory(Pid) when is_pid(Pid) -> case process_info(Pid, memory) of
+ {memory, M} -> M;
+ _ -> 0
+ end;
pid_memory(Name) when is_atom(Name) -> case whereis(Name) of
P when is_pid(P) -> pid_memory(P);
_ -> 0