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

Memory leak in DefaultCodeWhispererCodeCoverageTracker #4837

Open
rli opened this issue Aug 26, 2024 · 0 comments
Open

Memory leak in DefaultCodeWhispererCodeCoverageTracker #4837

rli opened this issue Aug 26, 2024 · 0 comments
Labels
bug We can reproduce the issue and confirmed it is a bug. codewhisperer

Comments

@rli
Copy link
Contributor

rli commented Aug 26, 2024

2024-08-26 12:09:21,229 [353074441] SEVERE - #c.i.o.u.ObjectTree - Memory leak detected: 'software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.DefaultCodeWhispererCodeCoverageTracker@581cb166' (class software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.DefaultCodeWhispererCodeCoverageTracker) 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: 'software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.DefaultCodeWhispererCodeCoverageTracker@581cb166' (class software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.DefaultCodeWhispererCodeCoverageTracker) 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:194)
	at com.intellij.openapi.application.impl.ApplicationImpl.destructApplication(ApplicationImpl.java:626)
	at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:557)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:542)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:531)
	at com.intellij.openapi.application.ex.ApplicationEx.exit(ApplicationEx.java:78)
	at com.intellij.ui.mac.MacOSApplicationProviderKt$initMacApplication$3$1.invoke(MacOSApplicationProvider.kt:71)
	at com.intellij.ui.mac.MacOSApplicationProviderKt$initMacApplication$3$1.invoke(MacOSApplicationProvider.kt:71)
	at com.intellij.ui.mac.MacOSApplicationProviderKt$submit$2.invokeSuspend(MacOSApplicationProvider.kt:165)
	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:229)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:211)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithImplicitRead(AnyThreadWriteThreadingSupport.kt:122)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1162)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:78)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:119)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	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:696)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$16(IdeEventQueue.kt:590)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithoutImplicitRead(AnyThreadWriteThreadingSupport.kt:117)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:590)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
	at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
	at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
	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$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
	at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
	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.<init>(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.util.Alarm.<init>(Alarm.java:143)
	at com.intellij.util.AlarmFactory.create(AlarmFactory.java:26)
	at software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.CodeWhispererCodeCoverageTracker.<init>(CodeWhispererCodeCoverageTracker.kt:71)
	at software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.DefaultCodeWhispererCodeCoverageTracker.<init>(CodeWhispererCodeCoverageTracker.kt:305)
	at software.aws.toolkits.jetbrains.services.codewhisperer.telemetry.CodeWhispererCodeCoverageTracker$Companion.getInstance(CodeWhispererCodeCoverageTracker.kt:290)
	at software.aws.toolkits.jetbrains.services.codewhisperer.editor.CodeWhispererEditorListener$editorCreated$1$1$1.documentChanged(CodeWhispererEditorListener.kt:32)
	at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$1(DocumentImpl.java:923)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:269)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277)
	at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:62)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:268)
	at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:920)
	at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:824)
	at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:664)
	at com.intellij.openapi.editor.impl.DocumentImpl.replaceText(DocumentImpl.java:530)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$3.run(FileDocumentManagerImpl.java:736)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$4(AnyThreadWriteThreadingSupport.kt:318)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:318)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:890)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$reloadFromDisk$5(FileDocumentManagerImpl.java:722)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:226)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.reloadFromDisk(FileDocumentManagerImpl.java:722)
	at com.intellij.openapi.fileEditor.FileDocumentManager.reloadFromDisk(FileDocumentManager.java:169)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.contentsChanged(FileDocumentManagerImpl.java:702)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$MyAsyncFileListener$1.afterVfsChange(FileDocumentManagerImpl.java:642)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.afterVfsChange(AsyncEventSupport.java:136)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.processEventsFromRefresh(AsyncEventSupport.java:159)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEventsInWriteAction(RefreshSessionImpl.java:243)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.lambda$fireEvents$1(RefreshSessionImpl.java:225)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runEdtProgressWriteAction$lambda$7$lambda$6(AnyThreadWriteThreadingSupport.kt:429)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
	at com.intellij.openapi.progress.util.PotemkinProgress.runInSwingThread(PotemkinProgress.java:156)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runEdtProgressWriteAction$lambda$7(AnyThreadWriteThreadingSupport.kt:429)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runEdtProgressWriteAction(AnyThreadWriteThreadingSupport.kt:427)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteActionWithNonCancellableProgressInDispatchThread(AnyThreadWriteThreadingSupport.kt:413)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread(ApplicationImpl.java:876)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEvents(RefreshSessionImpl.java:221)
	at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl.lambda$queueSession$2(RefreshQueueImpl.java:113)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$7(NonBlockingReadActionImpl.java:717)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:229)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$1(AnyThreadWriteThreadingSupport.kt:184)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:183)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:836)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:425)
	... 41 more
2024-08-26 12:09:21,230 [353074442] SEVERE - #c.i.o.u.ObjectTree - IntelliJ IDEA 2024.2  Build #IU-242.20224.300
2024-08-26 12:09:21,230 [353074442] SEVERE - #c.i.o.u.ObjectTree - JDK: 21.0.3; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-08-26 12:09:21,230 [353074442] SEVERE - #c.i.o.u.ObjectTree - OS: Mac OS X
2024-08-26 12:09:21,230 [353074442] SEVERE - #c.i.o.u.ObjectTree - Plugin to blame: Amazon Q version: 3.23-242

@rli rli added bug We can reproduce the issue and confirmed it is a bug. codewhisperer labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug. codewhisperer
Projects
None yet
Development

No branches or pull requests

7 participants
@rli and others