IntelliJ IDEA caches a great number of files, therefore the system cache may become overloaded. Sometimes the caches will never be needed again, for example, if you work with frequent short-term projects.
When you invalidate the cache, IntelliJ IDEA rebuilds all projects ever run in the current version of the IDE.
Note the following before you proceed:
The caches will not be deleted until you restart IntelliJ IDEA.
Opening and closing a project without invalidating the caches does not result in deleting any files.
Local History is not deleted when you invalidate the caches. However, mind that Local History has a retention period of 5 working days.
Clear the system cache
From the main menu, select.
In the Invalidate Caches dialog, select an action. You can invalidate the caches and restart the IDE, invalidate the caches without restarting the IDE, or just restart the IDE.
For details on where various user-specific files are stored, see Default IDE directories.