class MemoryProfiler extends StudioProfiler {

  public static void saveHeapDumpToFile(@NotNull ProfilerClient client,
                                        @NotNull Common.Session session,
                                        @NotNull HeapDumpInfo info,
                                        @NotNull OutputStream outputStream,
                                        @NotNull FeatureTracker featureTracker) {
    Transport.BytesResponse response = client.getTransportClient()
      .getBytes(Transport.BytesRequest.newBuilder().setStreamId(session.getStreamId()).setId(Long.toString(info.getStartTime())).build());
    if (response.getContents() != ByteString.EMPTY) {
      try {
        response.getContents().writeTo(outputStream);
        featureTracker.trackExportHeap();
      }
      catch (IOException exception) {
        getLogger().warn("Failed to export heap dump file:\n" + exception);
      }
    }
  }

  public  MemoryProfiler(@NotNull StudioProfilers profilers);

}