Intelli J IDEA takes forever to update indices

前端 未结 10 1701
走了就别回头了
走了就别回头了 2020-12-12 11:39

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 Mave

相关标签:
10条回答
  • 2020-12-12 12:22

    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.

    0 讨论(0)
  • 2020-12-12 12:23

    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.

    0 讨论(0)
  • 2020-12-12 12:25

    Delete caches in library folder

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

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

    0 讨论(0)
  • 2020-12-12 12:25

    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.

    0 讨论(0)
提交回复
热议问题