anchor.diff:                  "~p", [Mem div 1024 div 1024 div 1024]))
               ++ "GB"
       end.
  +
  +readable_pid_name(Pid) ->
  +    Name = case pid_groups:group_and_name_of(Pid) of
  +               failed ->
  +                   try element(2, process_info(Pid, registered_name))
  +                   catch _Level:_Reason ->
  +                           try_process_info(Pid, initial_call, dead_pid)
  +                   end;
  +               N -> element(2, N)
  +           end,
  +    case is_list(Name) of
  +        false -> io_lib:write(Name);
  +        true -> Name
  +    end.
  +
  +readable_grp_and_pid_name(Pid) ->
  +    case pid_groups:group_and_name_of(Pid) of
  +        failed ->
  +            try element(2, process_info(Pid, registered_name))
  +            catch _Level:_Reason ->
  +                    try_process_info(Pid, initial_call, dead_pid)
  +            end;
  +        N -> N
  +    end.
  +
  +try_process_info(Pid, Types) ->
  +    try erlang:process_info(Pid, Types)
  +    catch _:_ -> []
  +    end.
  +
  +try_process_info(Pid, Type, DefaultVal) ->
  +    try element(2, erlang:process_info(Pid, Type))
  +    catch _:_ -> DefaultVal
  +    end.
  +
  +process_info_get(undefined, _Type, DefaultVal) ->
  +    DefaultVal;
  +process_info_get(PropList, Type, DefaultVal) ->
  +    case lists:keyfind(Type, 1, PropList) of
  +        false -> DefaultVal;
  +        X -> element(2, X)
  +    end.
  
positive.code:                      Pid = element(1, X),
                       pdb:delete(Pid, TableName),
                       %% plot data is:
                       Status = try element(2, process_info(Pid, status))
                                catch _:_ -> dead_pid
                                end,
                       {vals_pid(X),
                        Status,
                        vals_mqlen(X)/Count,
                        vals_cpu_usage(X, Count),
                        try element(2, process_info(Pid, memory))
                        catch _Level2:_Reason2 -> 0
                        end}
                   end || X <- R1, is_tuple(X), is_pid(element(1, X)) ],
      SortedPlotData = lists:keysort(sort_by(State), PlotData),
      L = length(SortedPlotData),
  
negative.code:     catch _:_ -> ok
      end,
      {pdb:new(?MODULE, [set, protected]), false, false,
       os:timestamp(), 0, _SortBy = 4, self()}.
  
  -spec top() -> ok.
  top() ->
      io:format("~p~n", [io:rows(standard_io)]),
      Pid = pid_groups:find_a(?MODULE),
      comm:send_local(Pid, {enable_sampling, all}),
      comm:send_local(Pid, {sample_all}),
      comm:send_local(Pid, {enable_output, all}),
      comm:send_local(Pid, {output_all}),
      top_interactive(Pid).
  
  top_interactive(Pid) ->
      {ok, [Char]} = io:fread("> ", "~c"),
      Quit =
          case Char of
              "q" -> quit;
              "e" ->
                  comm:send_local(Pid, {output_off}),
                  Expr = io:parse_erl_exprs('expr>'),
                  comm:send_local(Pid, {enable_output, all}),
                  comm:send_local(Pid, {output_all}),
                  case element(1, Expr) of
                      ok ->
                          spawn(fun() -> erl_eval:exprs(element(2, Expr), erl_eval:new_bindings()) end),
  