Configuring IntelliJ IDEA VM options

April 21st, 2006 by Alexandra Rusina

The default VM options for IntelliJ IDEA may be not optimal when your project contains more than 10000 classes and developers often try to change the default options to minimize IntelliJ IDEA hangtime. But sometimes the changes make things even worse.
So, how to configure IntelliJ IDEA VM options optimally? That’s not so easy question to answer, since the configuration strongly depends on the project being developed.
However, it is a well-known fact that JetBrains “eats its own dog food” and uses IntelliJ IDEA for development of new IntelliJ IDEA versions. Therefore, we can recommend some settings that our developers use and explain the general memory policy.

1. -Xms = 32m (64m)
2. -Xmx = 256m

Please note that very big Xmx and Xms values are not so good. In this case, GarbageCollector has to work with a big part of memory at a time and causes considerable hang-ups. On the other hand, too small values can lead to the OutOfMemory exception. The specified values provide enough memory and at the same time the GarbageCollector works often but rather fast.
One more important thing is to pay attention to the memory indicator at the bottom-right corner of IntelliJ IDEA. If it shows that the memory in use is almost equal to the total memory available (let’s say 195m out of 220m), we recommend you to increase Xmx on 50m or so.

3. -XX:MaxPermSize=92m

This is a default value, and in most cases you don’t need to change it. You may increase it only if you get “OutOfMemoryError” in “PermGen space”.

4. -server

Some people find IntelliJ IDEA more responsive with this option. But it is not guaranteed.

5.   We don’t recommend to use the following options at all, since they are not very stable:
    -XX:+UseParallelGC
    -XX:+UseAdaptiveSizePolicy
    -XX:-UseConcMarkSweepGC


Technorati tags: ,

6 Responses to “Configuring IntelliJ IDEA VM options”

  1. Hassidi Says:

    I saw in the intellij.net website forum the followed: “-Dsun.awt.keepWorkingSetOnMinimize=true”.

    Is it safe? Is it usefull?

    I didn’t see it in your “not to use” parameters?

    Thanks.

  2. Alexandra Rusina Says:

    We don’t configure this option for IntelliJ IDEA. So, I can’t say whether it is actually useful or not.
    Probably, this link may help you somehow:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5043070

  3. Brad Says:

    Have the recommendations changed in the past couple of years or are these still the recommended JVM settings with 7.0.3?

  4. Michael Hunger Says:

    I finally boosted my IDEA to great performance again, just by buying a SSD drive.
    See:
    My IDE(A) is fast again

    Happy coding

    Michael

  5. Lahiru Gunathilake Says:

    Look, you haven’t mentioned that where do we have to do all of these changes.. why are you always missing basics and very simple stuff.. new Idea user will probably get lost with these instructions..

    You have to edit the idea.vmoptions file with those mentioned parameters.

    Lahiru

  6. On Boosting My IDE(A) – Jetbrains IntelliJ IDEA is fast again | Better Software Development Says:

    [...] There were several articles talking about IDEA optimizations. Mostly settings and JVM startup params. 10 Tips by Hamlet d’Arcy IDEA Performance Tuning by J2EE blogger IDEA VM options from the JetBrains blog [...]

Leave a Reply