anchor.diff:      NewMemInfo#mem_info.processes_used =< (PrevMemInfo#mem_info.processes_used + 50000) andalso
       NewMemInfo#mem_info.ets =< (PrevMemInfo#mem_info.ets + 50000 + (EntryEtsSize * NewItems)).
   
  --spec check_memory_inc(PrevMemInfo::#mem_info{}, NewMemInfo::#mem_info{}, NewItems::non_neg_integer(), AddedSize::non_neg_integer()) -> ok.
  +%% @doc Checks whether the NewMemInfo field indicates increased memory use
  +%%      compared to PrevMemInfo. AddedSize is the expected binary size
  +%%      difference.
  +%%      Note: Tolerates 250k binary and 250k processes_used overhead.
  +-spec check_memory_inc(
  +        PrevMemInfo::#mem_info{}, NewMemInfo::#mem_info{},
  +        NewItems::non_neg_integer(), AddedSize::non_neg_integer()) -> ok.
   check_memory_inc(PrevMemInfo, NewMemInfo, NewItems, AddedSize) ->
       % assume an entry for an item uses 4 * 1k memory for ets (excluding the binary size)
       EntryEtsSize = 4 * 1000,
  
positive.code:     #mem_info{binary = BinSize, atom_used = AtomUSize,
                processes_used = ProcUSize, ets = EtsSize}.
  
  -spec check_memory_inc_bool(PrevMemInfo::#mem_info{}, NewMemInfo::#mem_info{}, NewItems::non_neg_integer(), AddedSize::non_neg_integer()) -> boolean().
  check_memory_inc_bool(PrevMemInfo, NewMemInfo, NewItems, AddedSize) ->
      % assume an entry for an item uses 4 * 1k memory for ets (excluding the binary size)
      EntryEtsSize = 4 * 1000,
  
negative.code: -include("record_helpers.hrl").
  
  all()   -> [
              {group, api_tx},
              {group, ring}
             ].
  
  groups() ->
      [
       {api_tx, [], [write_1000, fill_1000, fill_2000, modify_100x100]},
       {ring,   [], [create_ring_100]}
      ].
  
  suite() -> [ {timetrap, {seconds, 300}} ].
  
  init_per_suite(Config) ->
      _ = code:ensure_loaded(gossip_load_default), % otherwise loaded too late
      unittest_helper:init_per_suite(Config).
  
  end_per_suite(Config) ->
      _ = unittest_helper:end_per_suite(Config),
      ok.
  
  init_per_group(Group, Config) ->
      ct:comment(io_lib:format("BEGIN ~p", [Group])),
      Config.
  
  end_per_group(Group, Config) ->
      ct:comment(io_lib:format("END ~p", [Group])),
      Config.
  
  init_per_testcase(_TestCase, Config) ->
  %%     Group = case proplists:get_value(tc_group_properties, Config) of
  %%                 undefined                 -> undefined;
  %%                 Props when is_list(Props) -> proplists:get_value(name, Props)
  %%             end,
      %% stop ring from previous test case (it may have run into a timeout)
      unittest_helper:stop_ring(),
      % start ring:
      {priv_dir, PrivDir} = lists:keyfind(priv_dir, 1, Config),
      unittest_helper:make_ring(1, [{config, [{log_path, PrivDir}, {monitor_perf_interval, 0}]}]),
      config:write(no_print_ring_data, true),
  