Daniel
Daniel

Reputation: 1072

IntelliJ 2016.3 high CPU usage spikes

A few days ago I've upgraded to IntelliJ ultimate 2016.3 and my CPU usage spikes to 50-80% when editing files, even writing a character. I'm running the 64bit .exe on Windows 10 Pro. I also tried increasing the custom vm options and I currently have this:

# custom IntelliJ IDEA VM options

-Xms512m
-Xmx2048m
-XX:ReservedCodeCacheSize=512m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

Another thing I tried was the Invalidate Caches option but it doesn't help. The IDE is basically unusable like this as it freezes my notebook. Does anyone know how to solve it?

Edit: I also tried IntelliJ 2016.2.5 but with the same issue. For the record previously I had 2016.2 with no problems.

Final edit:

I have large-ish source files on the project I'm working (1k+ and more) and the IDE seems to be too bloated to be able to handle them. What I tried:

Nothing helped too much. Searching online I found others with the same problem - basically that the IDE is unusable on large (1K or more) source files. This doesn't seem to be a bug so it's useless to report it. It forced me to move to eclipse which never had any high CPU issues on my machine.

To the reader: If you're in this situation spare yourself a couple of hours or more of useless tweaking and know there isn't much you can do.

Upvotes: 4

Views: 3258

Answers (2)

Levi
Levi

Reputation: 16

I have found that disabling Javascript "Unused JavaScript / Action Script local symbol" inspection has solved this issue for me in IntelliJ IDEA 2017.1 (had same problems in 2016.2). You can search for this setting in the settings pane.

I have submitted a ticket here -> https://youtrack.jetbrains.com/issue/IDEA-173800

Also checkout the suggestion here for JavaScript Inspections ( -> https://youtrack.jetbrains.com/issue/WEB-16757

Upvotes: 0

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

I've been using 2016.3 for a while now and have not noticed the CPU spikes (albeit, I am on OSX so this may not mean much).

First, I would recommend looking at the idea.log file (Help -> Show log in explorer) as the first place for anything obvious (such as a rogue plugin). Ideally, you'd tail the log file while typing in the editor and see what comes up in the log file.

Secondly, confirm if the problem is reproducible in a new project. If it is, then move on to the next step which is to capture a CPU Snapshot when the problem happens for a couple of minutes and creating a new issue at Youtrack. To capture a new CPU snapshot refer the official documentation "Reporting Performance Problems". Steps summarized below:


Step 1 : If using community edition, add YourKit profiler lib

(Skip if using ultimate edition)

IntelliJ IDEA and PyCharm Community Editions do not include a YourKit profiler agent, because the YourKit agent library is not open-source. To take a CPU or memory snapshot with the Community Edition, you can download an evaluation version of YourKit Java Profiler, copy the yjpagent library to the IDE bin directory, add it to the .vmoptions as described above, and connect to the running IDE instance from the standalone YourKit Profiler UI.


Step 2 : Enable the profile agent

Step TL;DR

Help | Edit Custom VM Options and add, at the end of the file, -agentlib:yjpagent64=delay=10000 if using 64 bit jvm or -agentlib:yjpagent=delay=10000 if using 32 bit

Details

enter image description here


Step 3 : Capture CPU Snapshot

enter image description here

Upvotes: 3

Related Questions