public static List<JavaReferenceInfo> calculateSizesByObjects(@NotNull EvaluationContextImpl context,
                                                                @NotNull List<ObjectReference> references,
                                                                @NotNull ProgressIndicator progressIndicator) {
    MemoryAgent agent = MemoryAgent.get(context);
    agent.setProgressIndicator(progressIndicator);
    try {
      Pair<long[], long[]> sizes = agent.getShallowAndRetainedSizesByObjects(
        context,
        references,
        Registry.get("debugger.memory.agent.action.timeout").asInteger()
      ).getResult();
      return IntStreamEx.range(0, references.size())
        .mapToObj(i -> new SizedReferenceInfo(references.get(i), sizes.first[i], sizes.second[i]))
        .sortedBy(ref -> -ref.getRetainedSize())
        .map(ref -> (JavaReferenceInfo)ref)
        .toList();
    }
    catch (EvaluateException e) {
      LOG.error("Could not estimate objects sizes", e);
    }

    return Collections.emptyList();
  }
public static List<JavaReferenceInfo> calculateSizesByObjects(@NotNull EvaluationContextImpl context,
                                                                @NotNull List<ObjectReference> references,
                                                                @NotNull ProgressIndicator progressIndicator)