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?
Please sign in to leave a comment.
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.
Thanks!
Ok, cool. So basically deleting `~/Library/Caches/<PRODUCT><VERSION>` on OSX that should cover `system/caches` directory. Right?
You can delete only the caches subdirectory inside that directory to keep local history and other useful stuff.