Is there a way to 'GC' the project caches?

[Hopefully this isn't a dupe - I got a timeout on posting]

I develop, advise or monitor many branches of our projects and have working copies checked out for several branches at a time.  As I use IDEA to open project files in these working copies the IDE caches information for each to improve performance - this works well.

As branches close and new ones appear, my list of working copies changes and projects will be locally deleted.  IDEA (v8.1) retains a substantial amount of cached content for, what are now non-existent, working copies.

Is there a way to get IntelliJ to perform garbage collection on cache content for project files that can no longer be found?

This would remove thousands of files and folders and free up several GB of space. At the moment I'm periodically blowing away the entire cache content which bites when I reload project files in branches that are still current.

NB: v7 appeared to slow down more as this cache volume increased - this is less of an issue with v8, possibly evidence of better indexing.

Comment actions Permalink

File->'Invalidate Caches' will remove all caches, though I am not sure if its just for the current project or all caches.
I saw in a recent jira that this has been documented in a recent EAP.

This is probably not what you want you can also see:

and make comments or vote for it.

Comment actions Permalink

I should have noted I was aware of the invalidate caches (it wipes the lot) so helpful, but not an ideal solution. It somewhat ameliorates the problem with the time spent reparsing projects being the main shortcoming.

As an example I invalidated my current caches, saving 1.8GB worth of content.  However the "invalidate -> restart IDEA -> reparse project" took just over 6 minutes.

That's just the one project I'm working on now.  Unless I manually reopen them all now (maybe another 30minutes of effort), that reparsing will bite me when I next open them (inconvenient if it's just for a code review/support).

I'll follow up in the JIRA issue and see if there are plans to improve this though It sounds a lot like the design of the caches does not easily lend itself to filtering based on project so I may have to live with this as it is.

Thanks for the help.


Please sign in to leave a comment.