List<JavaReferenceInfo> (@NotNull EvaluationContextImpl context, @NotNull ReferenceType classType, long objectsLimit, @NotNull ProgressIndicator progressIndicator) { MemoryAgent agent = MemoryAgent.get(context); agent.setProgressIndicator(progressIndicator); try { MemoryAgent.ObjectsAndSizes objectsAndSizes = agent.getSortedShallowAndRetainedSizesByClass( context, classType, objectsLimit, Registry.get("debugger.memory.agent.action.timeout").asInteger() ).getResult(); return IntStreamEx.range(0, objectsAndSizes.getObjects().length) .mapToObj(i -> (JavaReferenceInfo) new SizedReferenceInfo( objectsAndSizes.getObjects()[i], objectsAndSizes.getShallowSizes()[i], objectsAndSizes.getRetainedSizes()[i] ) ) .toList(); } catch (EvaluateException e) { LOG.error("Could not estimate objects sizes", e); } return Collections.emptyList(); }