Lots of CPU usage followed by IntelliJ running out of memory

Issue #1530 resolved
Andrew Visser created an issue

Like the title says, all of a sudden, I’m seeing lots of CPU usage in a resting IntelliJ. The Activity Monitory points to IC2. If left alone, the editor will eventually run our of heap and ask me to change the vmoptions.

Comments (22)

  1. Scott Wells repo owner

    Hi, Andrew. A few questions:

    1. How much heap are you allocating to the IDE now?
    2. Can you send me the idea.log* file(s) from the same timeframe as the issue?
  2. Andrew Visser Account Deactivated reporter

    Downgraded to 2.0.9.9 and everything seems fine. Was seeing error on 2.1.0.1-2. Not sure about 2.1.0.0

  3. Scott Wells repo owner

    Hmmmm....unfortunately I'm not seeing anything telling in either the memory dump or the log. I'd be curious to see a CPU profiler dump from the issue to see where the time is being spent.

  4. Scott Wells repo owner

    Please install the latest build, 2.1.0.4 (a re-issue of 2.1.0.3 which didn't resolve the issue) and see if that takes care of it. If it doesn't, please use the built-in profiler to produce a CPU snapshot when it's spiking the CPU and send that alongside your idea.log* file(s) from the same span of time.

  5. Andrew Visser Account Deactivated reporter

    So much better. There is still some memory churn even without me typing anything, but it is much much reduced. IC2 does not appear in the IntelliJ Activity Monitor so it might be other things I have installed.

    I’d call it fixed.

  6. Scott Wells repo owner

    Okay. I'm going to resolve this issue, but I'm also going to keep investigating the memory usage lead to see if I can determine if it's anything IC is in fact doing. Thanks for letting me know!

  7. LexV

    I’m also on 2.1.0.4, but I am still experiencing the same issue. UPDATE; I’m not sure if this means anything, but it seems to happen when I open a project that has a connection to a production environment. Closing the offending project also lowers the memory usage (another update; it doesn’t free up the memory always after closing the project)…

  8. Scott Wells repo owner

    Hi, Lex. I'm sorry to hear that you're still having this issue and definitely want to figure out what's going on. The main things that were added/changed in this weeks builds are some code inspections. Can you please disable the Annotation and modifier agreement and Control flow analysis inspections displayed below by unchecking them and see whether that resolves the issue?

    Issue_1530.png

    If it does, please re-enable them one at a time to help isolate which is causing the issue. If it doesn't, I'll likely need to get logs and/or CPU profiling info from you while this is happening. Let's start with the inspections, though.

  9. LexV

    Hey Scott,

    Thanks for your reply. I have all inspections disabled by default, so that probably rules that out. I’ll upload a thread dump and a log file soon (if I remember where to find them).

    Lex

  10. Scott Wells repo owner

    Ah, that's interesting. Unfortunately a thread dump only shows a single point in time. Do you mind emailing your idea.log* file(s) to support@illuminatedcloud.com. Also, if you're using a commercial JetBrains IDE, could you enable the Performance Testing plugin (if not already enabled), enable the CPU profile, reproduce the behavior, and capture a CPU snapshot? Here's more info:

    https://intellij-support.jetbrains.com/hc/en-us/articles/207241225-Performance-testing-plugin

    If you're using Community Edition, let me know and I'll see if there's another way to get the same info.

  11. LexV

    I’ve sent the e-mail. Unfortunately, I’m using the community edition. Hopefully we can still work something out.

  12. Andrew Visser Account Deactivated reporter

    Just upgraded to 2.1.0.5 and the issue is back. Attaching performance log of about a minute of 700% CPU usage.

  13. Scott Wells repo owner

    Andrew, looking at the provided log, something looks quite wrong with your IntelliJ IDEA installation. I see core IDE plugins that are failing:

    2020-02-17 11:13:23,063 [   1397]   WARN - llij.ide.plugins.PluginManager - Plugin "NodeJS" is incompatible (until build 191.SNAPSHOT < IU-193.6494.35) 
    2020-02-17 11:13:23,066 [   1400]   INFO - llij.ide.plugins.PluginManager - /Users/avisser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ IDEA.app/Contents/plugins/NodeJS overrides /Users/avisser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ IDEA.app.plugins/NodeJS 
    2020-02-17 11:13:23,066 [   1400]   WARN - llij.ide.plugins.PluginManager - Plugin "AngularJS" is incompatible (until build 173.SNAPSHOT < IU-193.6494.35) 
    2020-02-17 11:13:23,067 [   1401]   INFO - llij.ide.plugins.PluginManager - /Users/avisser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ IDEA.app/Contents/plugins/AngularJS overrides /Users/avisser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ IDEA.app.plugins/AngularJS 
    2020-02-17 11:13:23,076 [   1410]   INFO - llij.ide.plugins.PluginManager - Plugin "Gradle Extension" misses optional descriptor profiler-java-gradle.xml 
    2020-02-17 11:13:23,187 [   1521]   WARN - llij.ide.plugins.PluginManager - Plugin "Kotlin" is incompatible (until build 181.SNAPSHOT < IU-193.6494.35) 
    2020-02-17 11:13:23,188 [   1522]   INFO - llij.ide.plugins.PluginManager - /Users/avisser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ IDEA.app/Contents/plugins/Kotlin overrides /Users/avisser/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/193.6494.35/IntelliJ IDEA.app.plugins/Kotlin 
    

    NPEs in other core IDE functionality:

    2020-02-17 11:12:58,107 [ 131554]  ERROR - j.openapi.util.ShutDownTracker - null 
    java.lang.NullPointerException
        at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.lambda$releaseContent$35(FSRecords.java:1477)
        at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.writeAndHandleErrors(FSRecords.java:980)
        at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.releaseContent(FSRecords.java:1477)
        at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.releaseContent(PersistentFSImpl.java:675)
    

    and with regard to Illuminated Cloud, it looks like it's not even registering the file types properly:

    2020-02-17 11:18:44,549 [   4296]   INFO - ij.psi.stubs.StubUpdatingIndex - requesting complete stub index rebuild due to changes: removed file types:Apex 
    

    It's possible those are caused by you bouncing back and forth between Ultimate Edition to get this snapshot and Community Edition which you mentioned is your primary IDE. However, in the provided CPU snapshot (thanks!), the time is being spent in one of the core collection classes used by the base IDE:

    Issue_1530_Snapshot.png

    Before we diagnose this any further, I would recommend a full uninstall/reinstall of IntelliJ IDEA to see what effect that has, if any. There just seems to be too much questionable stuff going on in the log for me to feel like we're debugging the right thing just yet.

  14. Andrew Visser Account Deactivated reporter

    It was lexV running Community, but I’ll check out those errors and get a clean run.

  15. Scott Wells repo owner

    Ah, sorry for the confusion. That makes it even more important because all of that noise in the log is evidently based on execution of a strange state of IntelliJ IDEA Ultimate Edition. Thanks for clarifying!

  16. Log in to comment