private boolean isMemoryViewSuitable(@Nullable XExpression expression) {
    if (!(MemoryAgent.isAgentEnabled(myDebugProcess)
          && Registry.is("debugger.memory.agent.use.in.memory.view")
          && getInstancesProvider() instanceof InstanceProviderEx instanceProviderEx)) {
      return false;
    }
    boolean returnAll = instanceProviderEx.returnAllInstancesOfAClass();
    return returnAll && (expression == null || FilteringTask.isEmptyFilter(expression))
      || instanceProviderEx.estimateInstancesCount() <= MAX_TREE_NODE_COUNT;
  }
private boolean isMemoryViewSuitable(@Nullable XExpression expression)