Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.smallcloud.refactai.modes.ModeProvider holds released Editor #126

Open
ViugiNick opened this issue Apr 16, 2024 · 3 comments
Open

com.smallcloud.refactai.modes.ModeProvider holds released Editor #126

ViugiNick opened this issue Apr 16, 2024 · 3 comments

Comments

@ViugiNick
Copy link

Lambda in ModeProvider registered as MyScheduledFutureTask holds reference to a released editor that refers a number of disposed objects

(root): com.intellij.util.concurrency.AppDelayQueue$TransferThread
this$0: com.intellij.util.concurrency.AppDelayQueue
q: java.util.PriorityQueue
queue: java.lang.Object[]
[]: com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask
callable: java.util.concurrent.Executors$RunnableAdapter
task: com.smallcloud.refactai.modes.ModeProvider$$Lambda
arg$1: com.smallcloud.refactai.modes.ModeProvider
editor: com.intellij.openapi.editor.impl.EditorImpl
myPopupHandlers: java.util.ArrayList
elementData: java.lang.Object[]
[]: com.intellij.openapi.editor.impl.ContextMenuPopupHandler$Simple
myActionGroup: com.intellij.openapi.actionSystem.DefaultActionGroup
mySortedChildren: java.util.ArrayList
elementData: java.lang.Object[]
[]: com.intellij.diff.merge.MergeThreesideViewer$IgnoreSelectedChangesAction
this$0: com.intellij.diff.merge.MergeThreesideViewer (disposed)
(root): com.intellij.util.concurrency.AppDelayQueue$TransferThread
this$0: com.intellij.util.concurrency.AppDelayQueue
q: java.util.PriorityQueue
queue: java.lang.Object[]
[]: com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask
callable: java.util.concurrent.Executors$RunnableAdapter
task: com.smallcloud.refactai.modes.ModeProvider$$Lambda
arg$1: com.smallcloud.refactai.modes.ModeProvider
editor: com.intellij.openapi.editor.impl.EditorImpl
myCaretModel: com.intellij.openapi.editor.impl.CaretModelImpl (disposed)
(root): com.intellij.util.concurrency.AppDelayQueue$TransferThread
this$0: com.intellij.util.concurrency.AppDelayQueue
q: java.util.PriorityQueue
queue: java.lang.Object[]
[]: com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask
callable: java.util.concurrent.Executors$RunnableAdapter
task: com.smallcloud.refactai.modes.ModeProvider$$Lambda
arg$1: com.smallcloud.refactai.modes.ModeProvider
editor: com.intellij.openapi.editor.impl.EditorImpl
myView: com.intellij.openapi.editor.impl.view.EditorView (disposed)
@reymondzzzz
Copy link
Member

Hi! I didn't get :D Could you share more details about problem?

@ViugiNick
Copy link
Author

In the bug description I attached a few memory leaking paths. It looks like the task lambda in ModeProvider holds an instance of ModeProvider that holds released EditorImpl and retains disposed objects like MergeThreesideViewer, CaretModelImpl, EditorView

@ViugiNick
Copy link
Author

ModeProvider is also referenced from java.util.concurrent.Executors$RunnableAdapter

this$0: com.intellij.util.concurrency.AppDelayQueue
q: java.util.PriorityQueue
queue: java.lang.Object[]
[]: com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask
callable: java.util.concurrent.Executors$RunnableAdapter
arg$1: com.smallcloud.refactai.modes.ModeProvider
editor: com.intellij.openapi.editor.impl.EditorImpl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants