         kind, reason ->
           # would love to have this in a separate function, but elixir 1.7 complains
           send(tracer, :done)
-          send(parent, :shutdown)
+          send(parent, {ref, :shutdown})
           stacktrace = System.stacktrace()
           IO.puts(Exception.format(kind, reason, stacktrace))
           exit(:normal)

  defp return_memory({memory_usage, return_value}) when memory_usage < 0, do: {nil, return_value}
  defp return_memory(memory_usage_info), do: memory_usage_info

  defp measure_memory(fun, tracer) do
    :erlang.garbage_collect()
    send(tracer, :begin_collection)


      :ready_to_end -> nil
    end

    # We need to reference these variables after we end our collection so
    # these don't get GC'd and counted towards the memory usage of the function
    # we're benchmarking.
    {parent, fun}
  end

  defp get_collected_memory(tracer) do
