Lately more people have been complaining of slowdowns in IntelliJ. If you’re seeing frequent hangs or pauses, go to Help | Edit Custom VM Options… and then make sure you have the following two JVM arguments in the list:
The first ensures it’s using the (better) G1 collector, which became the default in Java 9. G1 is an incremental compacting collector so it’s able to clear more garbage with shorter pauses than the default gc. The second allows the Java heap to grow to 3gb.
You can also enable a memory tracker in the status bar in the preferences window. Expect usage to hover around the maximum…. G1 is lazy and won’t do more collection than it has to in order to stay under the -Xmx limit. If you click it you can force a full GC which will pause the app for several seconds. If when you do this heap usage drops a lot, then you’ve given it plenty of RAM. If it drops hardly at all that means most of your heap is live data and you should give it more breathing space.
For context I’m able to open, navigate and work with both open and enterprise codebases simultaneously with a 3GB Java heap, on an ordinary Macbook Pro that has 16GB of RAM. If you are seeing serious performance issues on hardware at least as good at that, it’s probably a configuration issue.