IntelliJ IDEA Indexing Takes Forever

Share
Workaround available Windows, macOS, Linux Updated November 13, 2026Based on 4 user reportsHow we research

Quick answer

IntelliJ re-scans files after startup, branch switches and build tool imports. If it never finishes, exclude build/output folders, restart with Invalidate Caches and give the IDE more heap.

Most likely fix: Exclude folders you do not edit

How to fix it

Try these in order — the most common fix is first.

  1. 1. Exclude folders you do not edit

    1. Right-click a folder such as build, target or node_modules in the Project tool window
    2. Choose Mark Directory as | Excluded
    3. Wait for the (shorter) re-index to finish
    Did this fix it?
  2. 2. Invalidate caches

    1. Open File | Invalidate Caches
    2. Tick the extra options only if a plain invalidation did not help
    3. Click Invalidate and Restart; caches are deleted only after the restart
    Did this fix it?
  3. 3. Raise the IDE heap

    1. Open Help | Change Memory Settings
    2. Increase the value (the -Xmx option)
    3. Click Save and Restart
    Did this fix it?
  4. 4. Exclude the IDE and project folders from antivirus

    1. Add your project directory and the IDE system/cache directories to the real-time scan exclusions of your antivirus
    2. Restart the IDE
    Did this fix it?
  5. 5. Keep projects on a local SSD

    1. Move the project out of network drives, synced folders (OneDrive, Dropbox) or slow external disks
    2. Reopen the project from the new location
    Did this fix it?

Symptoms

The status bar shows Indexing or Scanning files for minutes or hours, code completion and navigation are disabled, fans spin up.

Why it happens

  • Generated or dependency folders (target, build, node_modules, .gradle) are inside the project and get scanned
  • Corrupted caches or indexes
  • Heap too small, so the IDE spends time in garbage collection
  • Antivirus scanning the project and IDE system folders
  • Large monorepo with many modules

This guide also covers

  • intellij indexing forever
  • intellij stuck on indexing
  • intellij scanning files to index slow
  • intellij indexing takes too long

Still not working?

If JetBrains IntelliJ keeps failing, you're not alone. See every JetBrains IntelliJ problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

Other JetBrains IntelliJ errors

All 12 JetBrains IntelliJ errors and fixes →