I'm running on Arch Linux, on an i7-5930k 6 core CPU and 64GB of DDR4 RAM, and I'm using IntelliJ IDEA 14.
IDEA was working just fine for me several days ago, but one day, suddenly, it began hanging after opening a project, during the "Indexing" stage. I did not update IDEA and nothing changed about my projects. The IDE's UI hangs after it opens the project, with just a tiny little sliver of the progress bar for "Indexing" complete. Every 5-10 minutes or so it unfreezes and the progress bar crawls forward a little bit, before the IDE freezes again for another few minutes. This happens repeatedly for anywhere between 15 minutes and an hour, until it is finally finished indexing, at which point it hangs for another 5-10 minutes doing nothing, before it finally unlocks and allows me to develop.
While this is happening, my system is fairly unresponsive - Firefox tabs take a long time to switch, and scrolling in them is laggy. Opening a new terminal window takes a long time. Switching windows in general takes awhile. In htop
, one of my CPU cores is loaded at 100% while the rest have a normal load, and about 6GB of RAM is used (fairly normal load when this system is idle.)
Things I have tried that have not helped:
This issue is really hurting my workflow, if anybody has any solution to this I would be very greatful.
If indexing takes a significant amount of time, then it's likely that your project has more than two modules. Normally, you don't need all of them at same time. If this is the case, you can temporarily set aside (unload) the modules that you don't need right now.
Just Go to: File -> Setting -> Directories. Stop all the files that are going to included and need to empty ADD Content Root.
From the main menu, select File | Repair IDE. IntelliJ IDEA will automatically launch the first recovery step and refresh the virtual file system. IntelliJ IDEA will display a notification that you can use to continue or complete the recovery process.
Try Invalidating the cache and restarting IntelliJ.
In the File menu, select Invalidate Caches / Restart... and then click the Invalidate and Restart button.
I've finally figured it out. The solution was... Rather odd. TL;DR: Run it under strace
. Read on for a more detailed explanation.
I came upon it when I decided to run IntelliJ under strace
to see what files it was opening to determine whether or not it was a filesystem bottleneck.
This gave me some very strange results: strace
was spewing out a near-constant stream of segfaults. Not only that, but IntelliJ was running just fine, not taking forever to index.
After consulting with a friend, I learned that on Arch Linux, systemd logs a dump of a process's memory every time a segfault occurs, except when a debugger is attached. strace
is considered a debugger. Arch was thrashing my disks when it kept logging memory dumps due to all the segfaults, hence why the indexing was taking so long, because it was fighting for disk I/O.
My solution for now is to simply run IntelliJ under strace
. I will, however, be looking into the issue further, as I don't think java
should be segfaulting that much.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With