@Override
  public StackFrame getStackFrame() throws EvaluateException {
    DebuggerManagerThreadImpl.assertIsManagerThread();

    checkValid();

    if (myStackFrame == null) {
      try {
        final ThreadReference threadRef = myThreadProxy.getThreadReference();
        int index = getFrameIndex();
        // batch get frames from 1 to FRAMES_BATCH_MAX
        // making this number very high does not help much because renderers invocation usually flush all caches
        if (index > 0 && index < FRAMES_BATCH_MAX) {
          myStackFrame = threadRef.frames(0, Math.min(myThreadProxy.frameCount(), FRAMES_BATCH_MAX)).get(index);
        }
        else {
          myStackFrame = threadRef.frame(index);
        }
      }
      catch (IndexOutOfBoundsException e) {
        throw new EvaluateException(e.getMessage(), e);
      }
      catch (ObjectCollectedException ignored) {
        throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.thread.collected"));
      }
      catch (IncompatibleThreadStateException e) {
        throw EvaluateExceptionUtil.createEvaluateException(e);
      }
    }

    return myStackFrame;
  }
@Override
  public StackFrame getStackFrame()