How to Make IntelliJ IDEA 8 Usable on Linux

When it comes to Java projects, I’m a big fan of JetBrain’s IntelliJ IDEA. I’ve been using it for many year. I even owned a personal license when my work did not gave me one. So when version 8 came out, I upgraded quickly. Luckily for me, I did not delete right away the installation of version 7 that I had. IDEA 8 was practically un-usable. It was one of the very few applications that I have ever downgraded. It was so sluggishly slow that I practically could not use it. IntelliJ IDEA is a notoriously fat application, but it was so slow that I could not type a single line. But don’t worry! It’s not a ranting post. Solutions follow.

After a couple of days of wandering what the hell happened to my favorite IDE, I managed to google up the solution. Apparently, Java 1.6 has some issues with the Intel’s graphic card EXA acceleration method. Some people posted suggestions to alter the /etc/X11/xorg.conf to overcome these problems. I gave it a quick try, but it did not change much. Finally, I found this post in Ubuntu’s forums that solved the problem: Just disable Java’s option to use accelerated rendering. After all, IntelliJ IDEA is not exactly a first-person shooter game, so 3D acceleration is hardly called for.

So here’s the easy way: Just append the following line to the idea.vmoptions file.

-Dsun.java2d.pmoffscreen=false

Voila! IntelliJ IDEA 8 runs smoothly on my Ubuntu Linux machine. (Well, as smoothly as a 200MB  memory hog can…)

There are some other performance tricks that can be done using this file. You can increase the minimal heap size to make the loading faster, or add “MaxPermSize” to avoid slow-down for large projects. However, be careful! Increasing the maximum memory size to anything over 512MB will cause a significant slow-down, since the garbage collection will take forever.

Finally, one last issue on IntelliJ IDEA and Linux: There’s sometimes a problem to create a shortcut for IDEA. It seems to run great from the command line, but refuses to launch from a “.desktop” file. The reason for that is that the “idea.sh” script looks for an environment variable called “JAVA_HOME” instead of the regular “JDK_HOME”. A quick bypass to that problem is using the following command for the shortcut:

/bin/sh -c "export JDK_HOME=/usr/lib/jvm/java-6-sun && /opt/IntelliJIdea8/bin/idea.sh"

Of course, replace the JVM and IDEA dirs to their actual locations on your system.

So now IntelliJ IDEA 8′s shortcut is back to my quick-launch panel, where it belongs, and I intend to exploit it’s new features very soon (How can one write code generators without semantic support for Velocity templates?). I usually try to avoid depending too much on expensive software, but in the case of IntelliJ vs. other Java IDEs, I make an exception.

Posted Thursday, January 8th, 2009 under Programming.

Tags: ,

25 comments

  1. This was a huge help to me. Thanks!

  2. Great post,
    It made my day.
    Thank you

  3. Binh Nguyen says:

    Thanks god! You made my day.

  4. Wow, total lifesaver!

  5. Thanx a lot for sharing this info. Great post!

  6. Great stuff! Thanks a bunch!

  7. Lifesaver, thank you!

  8. awesome! Just upgraded to Jaunty and noticed a huge decline in performance. I have a nvidia graphics card btw – but adding “-Dsun.java2d.pmoffscreen=false” has worked.

  9. Thank you very much!!!

  10. perfect!
    silky smooth after this one :)

  11. Nice post. The “-Dsun.java2d.pmoffscreen=false” has worked for me.

    Thanks

  12. Thanks for taking the time to share this. Both tips worked for me. Nice with the performance increase and being able to start from the quick-launch panel again.

  13. Boy, I was REALLY hopeful when I found your post. I tried it, and… it may have helped a bit, but I’m still noticing that the GUI behavior in Idea 8 is really sluggish. What’s especially sluggish is the scrolling behavior. It responds in slow waves to the slightest vertical scroll adjustment, whereas in 7 (7.0.4) the response to scroll adjustment is immediate. Any further ideas? If so, I’d love to hear them. (Btw, my platform is Red Hat 4 and I’m using Idea 8.1.3). Thanks in advance.

  14. Hi Mark,
    Admittedly, I can’t solve each and every IntelliJ IDEA performance problem on Linux… I’m not a part of the JetBrains’ team and I’m not a kernel hacker. I managed to come up with the previous solution which is specific to a problem in Java’s interface with some graphics cards drivers. If it doesn’t work on your machine, the problem might be entirely different. Lack of RAM? Over-swapping? Problems with an old graphical toolkit? The best place for this question, I suppose, would be IntelliJ’s community forums. Sorry.

  15. Guy, thanks for your response. It sounds like your symptoms were far worse than what I’m seeing anyway. I’ll see what I can get from JetBrains.

  16. Cheers Guy, that has changed my world!

  17. -Dsun.java2d.pmoffscreen=false worked for me too. I remote login via xdmcp into my dev box and everything works wonderful except intellij. I was mystified. But this tip made the difference like night and day.

  18. thanks man this helped huge

  19. Wow, is that dramatic. I’m trying to switch from windows to linux at work and not having IntelliJ would have been a non-starter. It was horrifically slow. Practically unusable is too kind. It was totally unusable. But your fix restored it to the normal snappy response I was used to. Thank you so much. I only wish your post was easier to find. Any news if version X fixes this?

    Quincy Acklen
    IntelliJ 9
    Ubuntu 10.04
    HP 8530 laptop

  20. Wow, is that dramatic. I\’m trying to switch from windows to linux at work and not having IntelliJ would have been a non-starter. It was horrifically slow. Practically unusable is too kind. It was totally unusable. But your fix restored it to the normal snappy response I was used to. Thank you so much. I only wish your post was easier to find. Any news if version X fixes this?

    Quincy Acklen
    IntelliJ 9
    Ubuntu 10.04
    HP 8530 laptop

  21. In my case, changing to Sun JDK (from Open JDK) helped. I’m on Ubuntu 10.10 and IntelliJ 10.0.1.

  22. -Dsun.java2d.pmoffscreen=false
    This fixed the problem for me, running IntelliJ 10.0.2 on Ubuntu 10.04

  23. Much appreciated!

  24. I just moved away from gnome to XFCE. That just made a huge difference for me. I don’t think my graphics card with 128M was strong enough to handle both Gnome and IntelliJ because it works great on my slower laptop that has a 256M graphics card.

Leave a Reply

Security Code: