Lambda in CodeLocatorApplicationInitializedListener retains released EditorImpl

Open
#43 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Start at CodeLocatorApplicationInitializedListener, especially the lambda retaining editor and the editorPathMap field shown in the heap paths. Trace how listeners and map entries are registered and released, then reproduce the retained disposed EditorImpl objects; done means released editors and their disposed PsiAwareTextEditorComponent and CaretModelImpl are no longer reachable.

Written by the indexing model from the issue text.

Description

And in the subttree of the released editors there are references to disposed instances of PsiAwareTextEditorComponent, CaretModelImpl. Could you please take a look.

editor field:

     239MB/1 objects          | | | arg$1: com.intellij.openapi.editor.impl.EditorImpl
     238MB/1 objects          | | | myDocument: com.intellij.openapi.editor.impl.DocumentImpl
     238MB/1 objects          | | | myDocumentListeners: com.intellij.openapi.editor.impl.LockFreeCOWSortedArray
     238MB/1 objects          | | | value: [Lcom.intellij.openapi.editor.event.DocumentListener;
    68.5MB/4 objects          | | | []: com.bytedance.tools.codelocator.listener.CodeLocatorApplicationInitializedListener$5$1
    68.5MB/4 objects          | | | val$editor: com.intellij.openapi.editor.impl.EditorImpl
    66.5MB/4 objects          | | | myPanel: javax.swing.JPanel
    66.5MB/4 objects          | | | parent: com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorComponent(disposed)

editorPathMap field:

   65.0MB/1 objects          +-this$1: com.bytedance.tools.codelocator.listener.CodeLocatorApplicationInitializedListener$5
    65.0MB/1 objects          | editorPathMap: java.util.HashMap
    65.0MB/1 objects          | table: [Ljava.util.HashMap$Node;
   55.4MB/43 objects          | []: java.util.HashMap$Node
   34.9MB/38 objects          | +-key: com.intellij.openapi.editor.impl.EditorImpl
    22.0MB/5 objects          | | myCaretModel: com.intellij.openapi.editor.impl.CaretModelImpl(disposed)
Dominant language
Java
Stars
2.2k
Forks
182
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytedance/CodeLocator

All issues in bytedance/CodeLocator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.