IntelliJ IDEA 12.1 eat 100% CPU from time to time - intellij-idea

I've just updated my IntelliJ IDEA to latest 12.1 version and I found my laptop CPU usage become 100% from time to time, monitor the progress manager I found IDEA fork an new Java process regularly and it runs for several tens of seconds and shutdown. During that time the CPU usage is close to 100%:

Chances are the external build mentionned by #CrazyCoder compiles your project automatically when you make changes to your source files. If it annoys you too much, you can disable automatic compilation in File > Settings > Compiler > Make project automatically (uncheck the box).

I had the IDEA 12 process itself (not a forked Java) occupy 100%, and respond very slowly to keypresses, navigation, etc.
Eventually I resolved this by cleaning out the cache, prefs, Application Support dir, etc and uninstalling/reinstalling IDEA 12. You have to reinstate your preferences and let Idea reindex your projects (due to removing its cache) - but this shouldn't take long.
Here's a list of some places to clean on OS X (slightly out of date for IDEA 12, but a useful starting point).

I am using IntelliJ 13 Community Edition and have found this problem on Linux.
It my case it is the Intelli JBehave plugin causing these issues.
When opening a dialog the CPU usage of the Java process drops right back to 5 to 10% percent.
When disabling the plugin the same is true.

Goto Home Folder then Navigate to .IntelliJIdea13\config\options
Edit the file "project.default.xml" Change the VM_PARAMETERS Xmx and Xms as follows
It decreased the CPU usage to 50%

Related

UE4's editor is not loading beyond 18% on an Intel Macbook Air (BigSur)

I have recently started exploring game dev and wanted to do it using the Unreal Engine(4). However, the editor doesn't seem to be loading on my computer. I have displayed the UE4 window I keep having to look at upon launching the engine.
Could anyone please help me with this problem?
Thanks.
I'm no expert in Unreal Engine, and I don't know how long you've waited previously (do tell!), but UE4 is a massive, memory intensive engine that would struggle on any laptop (especially a Macbook). I personally use it on my laptop (an HP Pavillion) so it is possible, but there have been times when I am trying to open a project and I've had to wait for around 30 minutes for the percent to change (it was compiling shaders silently). Although, I've never seen it take too terribly long on startup (not opening a project). Try waiting for 30 minutes and see what happens (if you haven't already), otherwise I'm sure you know Unity is a lighter-weight option with comparable features.

Intellij gradle project sync takes long time

Gradle build command from terminal finishes in less than a minute but doing a refresh/sync on Intellij IDE taken 15 to 30 minutes. Tried to change the memory (-Xmx) to different levels 1g, 2g,3g upto 8g, still the time taken is in same range. Out project uses around 50 jars from maven/artifactory repo.
I profiled gradle process using YourKit Profiler, but not able to pin point and solve why it is taking so long. Never used YourKit before. Attached screenshots from YourKit below.
.
Event Timeline shows most of the time is spent on "socket.Read" events (attached below), other events have very negligible time spent.
UPDATE: Using Gradle version 4.1
YourKit has special product to profile Grable builds https://www.yourkit.com/projectx/eap/ It is available in EAP and it might help to understand what Gragle does under the hood.

Intellij IDEA 2016.2 high CPU usage

I have only one project (an ordinary SpringFramework project) opened. And the IDE is crazy using CPU:
JVisualVM CPU sample:
Note this happened just recently
Any idea?
The correct answer was posted by #matt-helliwell if you're coming from a version older than 2016.2.
File -> Invalidate Caches and Restart
If the above doesn't fix your problem, track this issue:
https://youtrack.jetbrains.com/issue/IDEA-157837
I invalidated the caches and it solved the problem for some time. But after a couple days Idea (my version is 2017.1.3) started to work slow with some freezing delays again. Finally I increased maximum available memory to 2 Gb (parameter -Xmx in idea.exe.vmoptions/idea64.exe.vmoptions file) and now it works perfect
I solved the problem by running idea64 bits :
JetBrains\IntelliJ IDEA 2016.2.4\bin\idea64.exe
Another possible solution, my IDEA was very slow because of a huge sql file open which was consuming all my CPU.
It took me a long time to notice this was happening only when opening a specific utility class with more than 1000 lines of code.
This class had maybe 50 public static methods (the reason why it is a utility class...), all pure.
At first, I thought it was stuck on a loop of "Performing code analysis" because that was the thing running heavily on the background as shown when hovering the mouse above a green check on top of the window of the offending class:
, but in reality, it was slowly scanning each instance in which the code was being executed in the entire source code.
It took like 45 minutes to scan the entirety of the class, the entire time the CPU usage at max (100%).
Once the class is closed the usage stops.
The issue (at least with AS Dolphin 2022-23) is that the analysis is never memorized, so if the window is closed, and opened later, the analysis begins from 0. So, it never gets cached...

IntelliJ memory issues

I have been using IntelliJ IDEA 12 for developing a Java Applications. I have the best experience for an IDE. It was working fine until recently. It started to show the heap size memory issue recommending to increase the Xmx and ask me to ignore or shutdown. The behaviour is weird as the IDE starts at 300 MB then it starts to take more memory until it reaches 750+ MB that's when it shows the problem.
I switched back to eclipse and the memory foot print is stable at 300 MB and doesn't increase by time like IntelliJ
Is IntelliJ doing some background process related to my code causing this increase? or is it a memory leakage problem with the IDE?
I've used IDEA for 10 years (and used IDEA 12 for a year before switching to IDEA 13 EAP builds) and have never had a memory issue. And I do not see any consistent mention of memory issues in the IDEA forums.
That said, a memory leak was just fixed (as in released today) in the IDEA 13 EAP. The VcsLogGraphTable class had a leak. The ticket does not give any indication if the leak was/is present in IDEA 12. Based on the name of the class, it should only come into play for Git or Hg graphs (but Hg graphs were added in 13). Based on my experience with how they do tickets, I interpret this as an IDEA 13 issue.
First, make sure you are using the latest version 12.1.6.
Often times memory issues are a result of a poorly written third party plug-in. You can try to disable any third party plug-ins and see if the issue is resolved.
The other thing you can do is follow the instructions in the document How to report IntelliJ IDEA performance problems and take CPU snapshots and report the issue to JetBrains. That way they can confirm a leak in IDEA 12, or tell you what plug-in is the culprit.

How to improve IntelliJ code editor speed?

I am using IntelliJ (Community Edition) for several months, and at first I'm pleased about its speed & simplicity. But now, after upgrading to version 10, it's extremely slow. Sometimes I click a file then it takes 5 - 15 seconds to open that file (it freeze for that time).
I don't know if I have done anything which cause that: I have installed 2 plugins(regex, sql), and have 2 versions of IntelliJ on my machine (now the version 9 removed, only version 10 remains).
Is there any tips to improve speed of code editor, in general, or specifically IntelliJ? I have some experience when using IntelliJ:
Should open IntelliJ a while before working, cause it needs time for indexing.
Don't open too many code tabs
Open as less other program as possible. I'm using 2 GB RAM WinXP, and it just seems fairly enough for Java, IntelliJ & Chrome at the same time.
Try to increase using memory size at %IDEA_HOME%\bin\idea.exe.vmoptions
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
Xms128m means that at startup there will be allocated 128 mb for heap.
Xmx512m means that maximum heap size available for IDEA is 512 mb
-XX:MaxPermSize=250m PermGen related to java heap.
Also you can set maximum garbage collector pause
-XX:MaxGCPauseMillis=10
That means that java's GC will take max 10ms to do his work.
And use concurrent Mark-Sweep (CMS) Collector (But i'm not sure that this will help for latest version of IDEA)
-XX:+UseConcMarkSweepGC
You should submit a CPU performance snapshot to the issue tracker as described in the FAQ.