summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-09-24 12:57:06 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-09-24 12:57:06 +0100
commit4f403fba9217a3c96a385ab75213f7aa3ffce576 (patch)
treeab82340309f60d441745cb8a418899ceb37869c0 /src
parentef36a52dbf54560de4bb4fa23758de027ea97942 (diff)
downloadrabbitmq-server-git-4f403fba9217a3c96a385ab75213f7aa3ffce576.tar.gz
Ignore dead processes.
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