Intelli J IDEA takes forever to update indices

MavenIdeIntellij IdeaIndexing

Maven Problem Overview


Is it normal for Intelli J to take a lot of time (almost 12 hours) to update indices for a project? I just installed Intelli J on my machine and imported a rather large Maven project (13k+ files).

I understand that the project is large but I let my computer up all night and when I woke up in the morning, Intelli J still hasn't finished updating the indices for the files yet, which makes it impossible to do anything since the popup with title 'Updating Index' keep hanging there in the middle of the screen.

Maven Solutions


Solution 1 - Maven

There are several answers in the Forums for different IntelliJ Versions, here is what I´ve tried (IntelliJ 13).

  • Give more Memory. Does not help anything with the 'Updating indices'
  • Delete .idea and iml in project. Does not help.

In the end what resolved my problem with 'Updating indices' was:

  • delete 'caches' folder in user/.IntellIJIdea13/system/

Solution 2 - Maven

I tried deleting the cache and it works perfectly. Thanks for the solution friends.

Just:

  1. Open IntelliJ IDEA
  2. Select the File menu
  3. Select the Invalidate Caches / Restart... menu.
    Once selected you get a pop-up with a bunch of options.
  4. Select Invalidate and Restart
    and before doing that make sure you saved all your changes else it might delete some unsaved changes.

Once you hit that, IntelliJ will restart and then you can see that all the indexing is done really fast.

Solution 3 - Maven

Delete caches in library folder

rm -rv ~/Library/Caches/IdeaIC15/caches/

On Mac OSX the location of cache is ~/Library/Caches

Solution 4 - Maven

In Intellij 2020.2 I faced this problem too. Restart/Invalidating cache didn't work for me. What I did was just deleting the cache folder in the following path:

C:\Users\davoud\AppData\Local\JetBrains\IntelliJIdea2020.2

Solution 5 - Maven

I had the same problem with IntelliJ 2017.2.3 - i.e. my project would keep updating indexes over and over again.

I discovered that I had gone over my disk quota in my home directory. By default IntelliJ stores the indexes in the home directory like this:

~/.IdeaIC2017.2/system/index/

The solution for me was to:

  1. Quit IntelliJ

  2. Move the whole .IdeaIC2017.2 directory to another mount which has more space:

    mkdir /space/ideaConfig
    mv ~/.IdeaIC2017.2 /space/ideaConfig/IdeaIC
    
  3. Update bin/idea.properties to point at the new index/config location:

    idea.config.path=/space/ideaConfig/IdeaIC/config
    idea.system.path=/space/ideaConfig/IdeaIC/system
    

It is possible that some of the other answers to this question were due to the same problem and were inadvertently fixed by "deleting caches folder", "invalidating caches" etc which would have potentially freed up enough disk space to build the indexes.

Solution 6 - Maven

Though the accepted and other answers may fix a particular problem, I have found that the problem with very long indexing times often comes from the fact that a repository contains or links to some directory that contains a large number of files. Often this is done for testing and the directory in question is not actually part of the project, e.g. ignored by the VCS.

The IDE does not automatically ignore those directories when indexing, but it is possible to "exclude" the directory from the project. This will prevent indexing as well.

Solution 7 - Maven

the easier way is as follow: file --> settings --> (uncheck) Synchronize files on frame or editor tab activation.

enter image description here

Solution 8 - Maven

I guess Idea is more collecting garbage than doing useful work. Use G1 GC instead of the default.

Help -- Edit Custom VM Options

-XX:+UseG1GC

instead of

-XX:+UseConcMarkSweepGC

and of course restart Idea.

Downside: G1 tries to collect garbage before stopping the process. This is insane, but this is what it does. For a program with 16G of heap, cleaning-up took 27 minutes. So do not configure your Idea to use a 16G heap.

Solution 9 - Maven

I was able to solve this by going to File -> Invalidate Caches / Restart

Then on the dialog that opens select "Invalidate and Restart"enter image description here

Solution 10 - Maven

you can manually exclude file or directory withIDEA Indexing, it can improve file load speed. some files are generated dynamic, we don't need index these files every time when we start IDEA.

Solution 11 - Maven

probably - old bug in caching system. it happens in ALL versions, especially if you upgrade your version of IntelliJ or JDK. To fix it:

  1. close the GUI.
  2. go to %HOME_DIR%.IntelliJIdeaXXXX\system\caches and delete it
  3. start the the GUI again.

Solution 12 - Maven

~/Library/Caches/JetBrains/IntelliJIdea2021.1 it's works for me..

Solution 13 - Maven

IDEA 2020.2 Right click folder under the Project, then mark as Exclude to exclude folder that you don't want to index

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Question0x56794EView Question on Stackoverflow
Solution 1 - Mavenanho-devView Answer on Stackoverflow
Solution 2 - Mavenuser2238153View Answer on Stackoverflow
Solution 3 - MavenShubham ChaudharyView Answer on Stackoverflow
Solution 4 - MavenD BView Answer on Stackoverflow
Solution 5 - MavenklshxshView Answer on Stackoverflow
Solution 6 - Mavenjpp1View Answer on Stackoverflow
Solution 7 - MavenZakaria AbdelhadiView Answer on Stackoverflow
Solution 8 - Maven18446744073709551615View Answer on Stackoverflow
Solution 9 - Mavennaib khanView Answer on Stackoverflow
Solution 10 - MavenWillieView Answer on Stackoverflow
Solution 11 - MavenIakov SenatovView Answer on Stackoverflow
Solution 12 - Mavenuser4336371View Answer on Stackoverflow
Solution 13 - Mavensung sungView Answer on Stackoverflow