       tracer = start_tracer(self())
 
       try do
-        _ = measure_memory(fun, tracer)
+        _ = measure_memory(fun, tracer, parent)
         word_size = :erlang.system_info(:wordsize)
         memory_used = get_collected_memory(tracer)
         send(parent, {ref, memory_used * word_size})

      :ready_to_begin -> nil
    end

    fun.()
    :erlang.garbage_collect()
    send(tracer, :end_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
