carlrobertoh / CodeGPT

The leading open-source AI copilot for JetBrains. Connect to any model in any environment, and customize your coding experience in any way you like.
https://codegpt.ee
Apache License 2.0
1k stars 212 forks source link

High CPU usage #716

Open fishermans opened 1 day ago

fishermans commented 1 day ago

What happened?

High CPU usage in IntelliJ IDEA 2024.2.2 and 2024.2.3 after installing version 2.10.1-241.1 up to current 2.11.3-241.1. Issue does not occur after downgrading to 2.9.0-241.1.

When opening settings, CPU usage is going down.

image

CodeCompletion is disabled for OpenAI in plugin settings.

Relevant log output or stack trace

"JobScheduler FJ pool 4/15" prio=0 tid=0x0 nid=0x0 runnable
     java.lang.Thread.State: RUNNABLE

    at com.intellij.codeInsight.daemon.impl.HighlightInfoUpdaterImpl.psiElementVisited(HighlightInfoUpdaterImpl.java)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectInformationWithProgress$11(GeneralHighlightingPass.java:192)
    at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$$Lambda/0x0000000802e14958.accept(Unknown Source)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.lambda$runAnnotator$2(AnnotatorRunner.java:153)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner$$Lambda/0x00000008030f28a0.apply(Unknown Source)
    at com.intellij.codeInsight.daemon.impl.AnnotationSessionImpl.computeWithSession(AnnotationSessionImpl.java:87)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.runAnnotator(AnnotatorRunner.java:119)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.lambda$runAnnotatorsAsync$0(AnnotatorRunner.java:66)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner$$Lambda/0x00000008030f1460.run(Unknown Source)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:279)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner.lambda$runAnnotatorsAsync$1(AnnotatorRunner.java:66)
    at com.intellij.codeInsight.daemon.impl.AnnotatorRunner$$Lambda/0x0000000802e3ddd0.process(Unknown Source)
    at com.intellij.concurrency.ApplierCompleter.processArrayItem(ApplierCompleter.java:116)
    at com.intellij.concurrency.ApplierCompleter.processArray(ApplierCompleter.java:196)
    at com.intellij.concurrency.ApplierCompleter.execAll(ApplierCompleter.java:166)
    at com.intellij.concurrency.ApplierCompleter.lambda$exec$0(ApplierCompleter.java:105)
    at com.intellij.concurrency.ApplierCompleter$$Lambda/0x0000000802b72300.run(Unknown Source)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$2(ApplierCompleter.java:148)
    at com.intellij.concurrency.ApplierCompleter$$Lambda/0x0000000802b70b60.run(Unknown Source)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager$$Lambda/0x00000008015b2910.compute(Unknown Source)
    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.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:159)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapAndRun$1(ApplierCompleter.java:140)
    at com.intellij.concurrency.ApplierCompleter$$Lambda/0x0000000802b70240.run(Unknown Source)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.executeByImpatientReader(AnyThreadWriteThreadingSupport.kt:486)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
    at com.intellij.concurrency.ApplierCompleter.wrapAndRun(ApplierCompleter.java:140)
    at com.intellij.concurrency.ApplierCompleter.exec(ApplierCompleter.java:108)
    at java.base@21.0.4/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
    at java.base@21.0.4/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
    at java.base@21.0.4/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
    at java.base@21.0.4/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
    at java.base@21.0.4/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

Steps to reproduce

Install and open a project.

CodeGPT version

2.11.3-241.1

Operating System

macOS

fishermans commented 18 hours ago

It seems to be related to whether a response is available in the page frame. If you delete the response, the CPU load goes down again and “unidentified: JobScheduler FJ pool” is no longer available in the Activity Monitor.

I downgraded to Intellij 2024.1.6. It doesn't happen there. Even completely remove and reinstall 2024.2.3 did not help.

threadDump-20240928-111046.txt