private void registerMemoryViewPanel(@NotNull RunnerLayoutUi ui) {
        if (!Registry.is("debugger.enable.memory.view")) return;

        final XDebugSession session = getSession();
        final DebugProcessImpl process = myJavaSession.getProcess();
        final InstancesTracker tracker = InstancesTracker.getInstance(myJavaSession.getProject());

        final ClassesFilteredView classesFilteredView = new ClassesFilteredView(session, process, tracker);

        final Content memoryViewContent =
          ui.createContent(MemoryViewManager.MEMORY_VIEW_CONTENT, classesFilteredView, JavaDebuggerBundle.message("memory.toolwindow.title"),
                           null, classesFilteredView.getDefaultFocusedComponent());

        memoryViewContent.setCloseable(false);
        memoryViewContent.setShouldDisposeContent(true);

        final MemoryViewDebugProcessData data = new MemoryViewDebugProcessData();
        process.putUserData(MemoryViewDebugProcessData.KEY, data);
        session.addSessionListener(new XDebugSessionListener() {
          @Override
          public void sessionStopped() {
            session.removeSessionListener(this);
            data.getTrackedStacks().clear();
          }
        });

        ui.addContent(memoryViewContent, 0, PlaceInGrid.right, true);
        final DebuggerManagerThreadImpl managerThread = process.getManagerThread();
        ui.addListener(new ContentManagerListener() {
          @Override
          public void selectionChanged(@NotNull ContentManagerEvent event) {
            if (event.getContent() == memoryViewContent) {
              classesFilteredView.setActive(memoryViewContent.isSelected(), managerThread);
            }
          }
        }, memoryViewContent);
      }
private void registerMemoryViewPanel(@NotNull RunnerLayoutUi ui)