K P
K P

Reputation: 851

IntelliJ IDEA consuming lots of CPU

I upgraded from IntelliJ IDEA from 12 CE to 13 CE few days ago and it has been hogging up CPU. Every few minutes it'll peak to 450-500% and then come down to 100-200%. Also, I've upgraded my Scala plugin to 0.30.380. Not sure what's causing the issue!?

Upvotes: 46

Views: 24609

Answers (5)

xlaoyu.Lee
xlaoyu.Lee

Reputation: 333

As other said,increasing memory heap of IDEA is work, my IDEA version is 2016.3.4, following is setting way

  1. Do one of the following:
    • Use the main menu command Help | Edit Custom VM Options to create a copy of the idea.vmoptions file in the user home. Refer to Edit Custom VM Options for details.
    • Copy the existing file from the IntelliJ IDEA installation folder somewhere and save the path to this location in the environment variable IDEA_VM_OPTIONS.
    • Copy the existing file /bin/idea.exe.vmoptions or /bin/idea64.exe.vmoptions from the IntelliJ IDEA installation folder into the location under your user home.

Upvotes: 1

ziggystar
ziggystar

Reputation: 28680

I'm posting this comment by K P as an answer, because K P does not have enough reputation.

It just needed some more memory to prevent repeated garbage collection. I found the file idea.vmoptions [aka idea64.exe.vmoptions] and increased the memory for InteiiJ to run (Xms = 512m and Xmx = 2048). The CPU usage has come down to 0.2 - 10% when nothing is being done on it.

Upvotes: 49

demian
demian

Reputation: 642

Try clean up cache and restart. In Intellij 14 go to menu File -> Invalidate Caches / Restart...

Upvotes: 2

pd12
pd12

Reputation: 825

If anyone's wondering the "right" way to edit the idea.vmoptions or idea64.vmoptions file, here it is: https://www.jetbrains.com/idea/help/tuning-intellij-idea.html

On *NIX, you want to copy

<IntelliJ IDEA installation folder>/bin/idea64.vmoptions

to:

$HOME/.IntelliJIdeaXX/idea64.vmoptions

and edit that file to increase the heap memory for IntelliJ IDEA

(OP's example settings: Xms = 512m and Xmx = 2048)

Upvotes: 0

user2982704
user2982704

Reputation: 159

Go to your home folder, then navigate to .IntelliJIdea13\config\options

Edit the file project.default.xml by changing the VM_PARAMETERS Xmx and Xms as follows:

<option name="VM_PARAMETERS" value="-Xmx2048m -Xms512m -XX:MaxPermSize=250m -ea" />

It decreased the CPU usage to 50%.

Upvotes: 4

Related Questions