Why is IntelliJ IDEA hanging on “Indexing”?

百般思念 提交于 2019-12-02 16:33:25

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.

BuffK

edit Intellij[VERSION]/bin/idea.properties, set idea.max.intellisense.filesize=50

update: Intellij will skip index files that size larger than 50kb.try this if you have many libraries or many large files(too many characters one line or too many lines)

I had this issue as well with version 2016.2 on Mac OS X. I had to do a force quit to end the application, then I deleted the .idea folder. The next time I launched IntelliJ everything worked fine, it had no problem indexing the project.

Select Help -> Debug Log Settings...

Add the following line (note the leading # symbol)

#com.intellij.util.indexing:trace

Relaunch the IDE (don't need to invalidate cache as that will cause it to start from scratch, whereas restarting from the point of failure, for me anyway, reported the problem file as soon as I restarted):

Scheduling indexing of file://C:/dev/tools/ruby/lib/ruby/2.2.0/x64-mingw32/win32ole.so by request of index Stubs

Our project doesn't use win32ole so I moved the file to a safe location and restarted my IDE... Bingo, problem gone, indexing finally completed after almost 1 year of effectively using intellij as a slightly-smarter-than-notepad ruby editor.

Had the same issue in the past on some Scala project. I have installed IDEA 16 EAP (https://confluence.jetbrains.com/display/IDEADEV/IDEA+16+EAP) and the problem has gone.

In my case I found out that Intellij is actually trying to index a 50GB directory with logs that was under the project's root. Make sure that if you have such a directory, it is marked as "Excluded" in the IDE.

You can see which file the IDE is indexing currently in the Indexing Status window (access by clicking on the indexing message in the toolbar). You may need to enlarge this window to see the full path of the file currently being indexed.

In PhpStorm, what solved this for me was excluding folders I didn't need to be indexed from the indexing (specifically the vendor folder, a caches folder, and a few asset folders that contained thousands of images). Instantly it began making progress and completed.

To do this:

  1. in the project directory list, right click the folder you want to exclude
  2. Mark Directory As
  3. Excluded

I had the same problem with IntelliJ 2017.3.2. When I clicked on the indexing progress bar I noticed it was hung on a directory within my build directory. When I did a gradlew clean which removed that directory then the indexing was able to proceed.

I have encountered this problem, and resolved it:

  1. remove idea
  2. delete all files and dirs which name regex 'jetbrain' and 'IntelliJ' in my computer(Mac mini)
  3. then install idea

I also try just delete idea cache files, it do not work.

Alex Gligor

I was able to resolve this problem by removing all of my "target" folders from my project.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!