Java – Why is IntelliJ IDEA hanging on “Indexing”

ideintellij-ideajava

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:

  • Delete caches folder
  • Delete entire ~/.IntelliJIDEA14 folder
  • Reinstall IntelliJ package
  • Download IntelliJ manually from JetBrains' site and run it from my Downloads folder (to see if there was something wrong with the Arch AUR package)
  • Configure IntelliJ to use my system JVM and Maven for importing instead of its embedded tools
  • Opening multiple different projects (not just the one I initially experienced the issue on.)

This issue is really hurting my workflow, if anybody has any solution to this I would be very greatful.

Best Answer

Try Invalidating the cache and restarting IntelliJ.

In the File menu, select Invalidate Caches / Restart... and then click the Invalidate and Restart button.