optimizing IntelliJ Idea performance on Ubuntu

When I have started developing on Ubuntu using IntelliJ Idea IDE, I have encountered a real trouble with IDE’s performance, it was just killing. After few hours of googling I have accumulated an instruction how to improve java related IDE performance on Ubuntu (and Ubuntu’s performance too).

This simple guide will help you to develop with pleasure:

— If you have only open jdk it will slow down the performance, you have to switch to the sun jdk to have a really robust performance
1) Install sun-java (before Ubuntu 11):
sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
sudo apt-get update
sudo apt-get install sun-java6-jdk
— If you are newbie, you should know – you are able to use TAB button to select OK button in the installation wizard window
— Optionally you are welcome to install any kind of additional sun-java packages:
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

1) Install sun java for Ubuntu 11+
Source: http://superuser.com/questions/353983/how-do-i-install-the-sun-java-sdk-in-ubuntu-11-10-oneric

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin

— To get sun-java benefits, you have to select it to be used as a regular java machine on your computer

2) Select sun-java:
sudo update-alternatives –config java
2.1) Select necessary jdk and hit enter

— Export environment variable to allow apps to use jdk
3) Export JAVA_HOME and edit bashrc file
# Necessary for Idea
export JDK_HOME=”/usr/lib/jvm/java-6-sun-1.6.0.xx

— If you have 3+ GB of RAM it is necessary to extend Ubuntu’s RAM support
4) Install 4 GB support on ubuntu – PAE:
— Source: www.cyberciti.biz/faq/ubuntu-linux-4gb-ram-limitation-solution/
4.1) Check free memory using terminal: free -m
4.2) Install PAE:
sudo apt-get update
sudo apt-get install linux-headers-server linux-image-server linux-server
sudo reboot
4.3) Check free memory again: free -m

— You are able to tune Idea memory usage via special configuration file
5) Increase possible memory usage for Idea in special file: idea.vmoptions
-Xms328m
-Xmx1500m
-XX:MaxPermSize=250m
-ea

AS a result my idea become working 20 times faster!

7) Happy codding (:

Best regards,
Yahor