Saturday, November 18, 2006

Getting IDEAs Flowing

This is a story about starting IDEA 6 on my Gentoo GNU/Linux machine. IDEA 6 has been out a while now, but I'm not the kind of person to buy the first release of a new version of software. I like to wait until the more adventurous types take it for a spin and shake the first few waves of bugs out. So now that it's at maintenace release 2 I'm taking it out for a spin.

Getting it running was a bitch. With the default settings I could get as far as the "loading project" dialog box. It just hung there, forever, which was long enough for me to notice that they've fixed one of (a few) annoyances I have with version 5.


Whenever IDEA is running a command that is taking a while, the "tip of the day" dialog box attaches itself to the progress meter. In 5 the dialog box is vertically too small to read the text inside it. I always have to pull the edge of the box down to see the tip. After the first few times I gave up on the "tip of the day" all together. After I realized I can actually see what's in the box I started flipping through them while I waited for IDEA to complete startup. Very insightful stuff. It turns out there are a plethora of shortcuts that I didn't know about. Which sucks. Think off all the time I could have saved w/ the new shortcuts instead of mousing around the editor.

At first I thought it was just busy importing and converting the settings and configuration from the old install. So I fired up Spider Solitaire in XP/VMWare and started listening to episode 236 of This American Life. That's how I normally pass the time when I need to wait for a computer to do something and I don't want to change my mindset to a different computer related task.

After fifteen minutes it still wasn't done and trying to close the window was getting me nowhere. So I murdered it with a 9 caliber signal. Fortunately I had started it from a shell so I could see the STDERR messages. The JVM was throwing OOM errors related to a too small perm gen size. A quick cat of {INSTALL_DIR}/bin/idea.vmoptions revealed a mandatory limit of 99MB. An easy fix. Just remove the offending line because the JVM --Sun JVM 1.5_08 Linux, to be specific-- defaults to ~130MB. Fired it up again and got to the main menu. Yippee!! Things are looking up.


I tried opening the last project I was working on and the project loads but the editor refuses to accept input. Then the window loses focus and one of the CPUs hit 100%. top tells me IDEA is the offending process. I figured I would give it more time. Maybe it will settle down after a while plus I've got This American Life on pause and episode 236 is quite good. So I unpause and started another round of Spider Solitaire. A few minutes go by and the JVM starts complaining the perm gen size is still too small. No problem. I run a server class machine w/ 12GB of RAM of which 4GB is in use so I've got plenty to spare. So I run echo "-XX:MaxPermSize=256m" >> {INSTALL_DIR}/bin/idea.vmoptions and rerun the start script. It gets to the main menu in a reasonable amount of time. So far so good. I reopen the project and cross my fingers. Booyah! 256MB is the magic number. Hooray!!