Automate "Invalid Caches / Restart"

Answered

I have an Ultimate Edition of IntelliJ IDEA. I work on an extremely large project & every so often IntelliJ slows down, hangs etc. I found out that doing "Invalid Caches / Restart" once in a while will resolve this issue.

But since it takes upwards of 10 minutes for this process to complete, I would like to automate this process so that it runs in middle of night, when I dont need the IDE.

So is there a way to do this from command line, so that I can put it in a cron job?

0
3 comments

You can shut down IntelliJ IDEA externally (using kill or similar command), then delete system/caches directory (https://intellij-support.jetbrains.com/hc/articles/206544519), then start it again. It will have the same effect as Invalidate Caches & Restart.

0
Avatar
Permanently deleted user

Thanks!

Ok, cool. So basically deleting `~/Library/Caches/<PRODUCT><VERSION>` on OSX that should cover `system/caches` directory. Right?

0

You can delete only the caches subdirectory inside that directory to keep local history and other useful stuff.

0

Please sign in to leave a comment.