IntelliJ-based IDE performance issues.
The Pitch
IntelliJ-based IDEs has everything you could possibly need for development of their specific language, and has great integration with other languages you might need along the way. I only have one issue: performance. These IDEs is 20x heavier than they need to be. Part of this comes from the Java runtime, but most of it is unnecessary operations, or things being done the wrong way.
My Theory.
Java is very heavy if you don't mind how it handles your code's execution internally. This is one of those situations. You incorrectly handle indexing operations and many clangd integrations. What I mean by that is you start courotines without blocking the main thread, which causes Java to spawn more threads every time it happens to handle execution, but you aren't the one managing that thread, causing stacking performance hold-ups, memory over-allocaation, and GC pauses blocking the wrong threads at the wrong times.
What Causes This?
I currently use CLion the most, which like every other IDE that JetBrains currently has is based on IntelliJ. CLion doesn't even do most of the work for indexing, clangd does. So why is it using so much memory? I decided to investigate CLion, and found these issues:
-
CLion implicitly spawns unused threads. In my experience with Java, this happens if you set up asynchronus operations and try to run them from the main thread. Java automatically spawns a new thread if it doesn't already have one to execute it. However, it does not close these threads until the code that needed them gets garbage collected, or the code closes them. CLion spawns a new thread just to manage
clangd, which seems fine on its own, but spawns another thread just to runclangd. - CLion keeps inactive background operations without cleaning them up. This means inactive operations are excluded from the garbage collector and use a lot of memory that never gets reclaimed until CLion exits.
- Expensive window focus/unfocus optimizations block the main thread. If you are on a lower-power device (like a laptop) and move between windows a lot, IntelliJ-based IDEs like CLion keep doing expensive optimizations like pausing indexing threads in the middle of their operation. This causes the IDE to freeze momentarily.
To the CLION team
Please fix this. I'm sure you know how, you'd just rather ignore this because the IDE technically works and nobody complains too loud.
Please sign in to leave a comment.