anchor.diff:                       Pid = element(1, X),
                        pdb:delete(Pid, TableName),
                        %% plot data is:
  -                     Status = try element(2, process_info(Pid, status))
  -                              catch _:_ -> dead_pid
  -                              end,
  +                     Infos = try_process_info(Pid, [status, memory, stack_size]),
  +                     Status = process_info_get(Infos, status, dead_pid),
                        {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}
  +                      process_info_get(Infos, memory, 0),
  +                      process_info_get(Infos, stack_size, 0)}
                    end || X <- R1, is_tuple(X), is_pid(element(1, X)) ],
       SortedPlotData = lists:keysort(sort_by(State), PlotData),
       L = length(SortedPlotData),
  
positive.code: -export([top/0]).
  
  -type state() :: { pdb:tableid(),
                     boolean(), %% monitoring is on
                     boolean(), %% output is on
                     erlang_timestamp(), %% last output
                     non_neg_integer(), %% # of measures
                     non_neg_integer(), %% sort by
                     no_exclude | pid()
                   }.
  
  
  -spec start_link(list()) -> {ok, pid()}.
  start_link(Group) ->
      gen_component:start_link(?MODULE, fun ?MODULE:on/2, [],
                               [{erlang_register, ?MODULE},
                               {pid_groups_join_as, Group, ?MODULE}]).
  
  -spec init([]) -> state().
  init([]) ->
  
negative.code:                 "~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.
  