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

Plugin Build reports a memory leak #196

Open
jborgers opened this issue Nov 18, 2024 · 2 comments
Open

Plugin Build reports a memory leak #196

jborgers opened this issue Nov 18, 2024 · 2 comments

Comments

@jborgers
Copy link
Collaborator

In IntelliJ 2024.3 a memory leak is reported when building the plugin.

2024-11-18 17:37:54,453 [ 9162] SEVERE - #c.i.o.u.ObjectTree - Memory leak detected: 'com.intellij.openapi.vcs.configurable.VcsDirectoryConfigurationPanel[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]' (class com.intellij.openapi.vcs.configurable.VcsDirectoryConfigurationPanel) was registered in Disposer as a child of 'ROOT_DISPOSABLE' (class com.intellij.openapi.util.Disposer$2) but wasn't disposed.
Register it with a proper 'parentDisposable' or ensure that it's always disposed by direct Disposer.dispose() call.
See https://plugins.jetbrains.com/docs/intellij/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

java.lang.RuntimeException: Memory leak detected: 'com.intellij.openapi.vcs.configurable.VcsDirectoryConfigurationPanel[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]' (class com.intellij.openapi.vcs.configurable.VcsDirectoryConfigurationPanel) was registered in Disposer as a child of 'ROOT_DISPOSABLE' (class com.intellij.openapi.util.Disposer$2) but wasn't disposed.
Register it with a proper 'parentDisposable' or ensure that it's always disposed by direct Disposer.dispose() call.
See https://plugins.jetbrains.com/docs/intellij/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

at com.intellij.openapi.util.ObjectNode.assertNoChildren(ObjectNode.java:45)
at com.intellij.openapi.util.ObjectTree.assertIsEmpty(ObjectTree.java:220)
at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:223)
at com.intellij.openapi.util.Disposer.assertIsEmpty(Disposer.java:217)
at com.intellij.openapi.application.impl.ApplicationImpl.disposeContainer(ApplicationImpl.java:191)
at com.intellij.openapi.application.impl.ApplicationImpl.destructApplication(ApplicationImpl.java:635)
at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:566)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$exit$2(ApplicationImpl.java:554)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421)
at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2(IdeEventQueue.kt:1045)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Caused by: java.lang.Throwable
at com.intellij.openapi.util.ObjectNode.(ObjectNode.java:24)
at com.intellij.openapi.util.ObjectNode.findOrCreateChildNode(ObjectNode.java:140)
at com.intellij.openapi.util.ObjectTree.register(ObjectTree.java:52)
at com.intellij.openapi.util.Disposer.register(Disposer.java:156)
at com.intellij.openapi.ui.LoadingDecorator.(LoadingDecorator.kt:78)
at com.intellij.openapi.ui.LoadingDecorator.(LoadingDecorator.kt:27)
at com.intellij.ui.components.JBLoadingPanel.init$lambda$0(JBLoadingPanel.kt:27)
at com.intellij.ui.components.JBLoadingPanel.(JBLoadingPanel.kt:34)
at com.intellij.ui.components.JBLoadingPanel.(JBLoadingPanel.kt:25)
at com.intellij.openapi.vcs.configurable.VcsDirectoryConfigurationPanel.(VcsDirectoryConfigurationPanel.kt:144)
at com.intellij.openapi.vcs.configurable.VcsMappingConfigurable.createComponent(VcsMappingConfigurable.java:47)
at com.intellij.ide.ui.search.TraverseUIStarterKt.processConfigurables(TraverseUIStarter.kt:424)
at com.intellij.ide.ui.search.TraverseUIStarterKt.access$processConfigurables(TraverseUIStarter.kt:1)
at com.intellij.ide.ui.search.TraverseUIStarterKt$doBuildSearchableOptions$2.invokeSuspend$lambda$0(TraverseUIStarter.kt:367)
at com.intellij.openapi.application.CoroutinesKt.writeIntentReadAction$lambda$1$lambda$0(coroutines.kt:329)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
at com.intellij.openapi.application.CoroutinesKt.writeIntentReadAction$lambda$1(coroutines.kt:329)
at com.intellij.openapi.progress.CoroutinesKt.blockingContextInner(coroutines.kt:341)
at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invokeSuspend(coroutines.kt:233)
at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:232)
at com.intellij.openapi.application.CoroutinesKt.writeIntentReadAction(coroutines.kt:328)
at com.intellij.ide.ui.search.TraverseUIStarterKt$doBuildSearchableOptions$2.invokeSuspend(TraverseUIStarter.kt:363)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:44)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:218)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:351)
... 18 more
2024-11-18 17:37:54,454 [ 9163] SEVERE - #c.i.o.u.ObjectTree - IntelliJ IDEA 2024.3 Build #IC-243.21565.193
2024-11-18 17:37:54,454 [ 9163] SEVERE - #c.i.o.u.ObjectTree - JDK: 21.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-11-18 17:37:54,454 [ 9163] SEVERE - #c.i.o.u.ObjectTree - OS: Mac OS X

@jborgers
Copy link
Collaborator Author

Strange, I don't see any pmd in the stack traces. Also, we don't directly use the reported objects/classes.

@jborgers
Copy link
Collaborator Author

According to the documentation, it seems to me that we don't handle disposing properly. Only PMDProjectComponent implements Disposable and it doesn't dispose any resources. PMDConfigurable has a disposeUIResources method which doesn't conform.

I guess this is not new in this version of intelliJ, so it should be fixed, yet, no need to fix urgently.

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

1 participant