anchor.diff:      #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().
  +%% @doc Checks whether the NewMemInfo field indicates increased memory use
  +%%      compared to PrevMemInfo and returns whether this is the case or not.
  +%%      AddedSize is the expected binary size difference.
  +%%      Note: Tolerates 50k binary and 50k processes_used overhead.
  +-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,
  
positive.code:            [Status, erlang:memory(total), erlang:memory(binary), Table, Memory, ContentSize]),
      garbage_collect_all().
  
  -spec get_meminfo() -> #mem_info{}.
  get_meminfo() ->
      [{binary, BinSize}, {atom_used, AtomUSize}, {processes_used, ProcUSize}, {ets, EtsSize}] =
  
negative.code:     check_memory_inc(PrevMemInfo, NewMemInfo, (End - Start + 1), MyBinSize),
      ok.
  
  create_ring_100(Config) ->
      % stop the initial ring (the ring is needed to initialise atoms etc.)
      unittest_helper:stop_ring(),
      garbage_collect_all(),
  
      {priv_dir, PrivDir} = lists:keyfind(priv_dir, 1, Config),
      OldProcesses = unittest_helper:get_processes(),
      PrevMemInfo = get_meminfo(),
      util:for_to(
        1, 100,
        fun(_I) ->
                unittest_helper:make_ring(1, [{config, [{log_path, PrivDir}, {monitor_perf_interval, 0}]}]),
                unittest_helper:stop_ring()
        end),
      garbage_collect_all_and_check(10, PrevMemInfo, 0, 0),
      NewMemInfo = get_meminfo(),
      NewProcesses = unittest_helper:get_processes(),
      {_OnlyOld, _Both, OnlyNew} =
          util:split_unique(OldProcesses, NewProcesses,
                            fun(P1, P2) ->
                                    element(1, P1) =< element(1, P2)
                            end, fun(_P1, P2) -> P2 end),
      ?equals(OnlyNew, []),
  %%     ct:pal("~p~n", [erlang:memory()]),
      check_memory_inc(PrevMemInfo, NewMemInfo, 0, 0),
      ok.
  
  %% @doc Starts garbage collection for all processes.
  garbage_collect_all() ->
      _ = [erlang:garbage_collect(Pid) || Pid <- processes()],
      % wait a bit for the gc to finish
  