void (@NotNull XDebugSession session) { XDebugProcess process = session.getDebugProcess(); if (!(process instanceof JavaDebugProcess javaDebugProcess)) return; DebugProcessImpl debugProcess = javaDebugProcess.getDebuggerSession().getProcess(); SuspendContextImpl suspendContext = debugProcess.getSuspendManager().getPausedContext(); PathsToClosestGcRootsDialog dialog = this; debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(suspendContext) { @Override public void contextAction(@NotNull SuspendContextImpl suspendContext) { if (dialog.isDisposed()) { return; } EvaluationContextImpl evaluationContext = new EvaluationContextImpl(suspendContext, suspendContext.getFrameProxy()); MemoryAgent memoryAgent = MemoryAgent.get(evaluationContext); Disposer.register(dialog.getDisposable(), () -> memoryAgent.cancelAction()); memoryAgent.setProgressIndicator(dialog.createProgressIndicator()); } }); }