Customising Netbeans for better performance and ease of use as a PHP IDE

For all my day to day development work, be it in php, html, js and even when I branch out into Java or C/C++, I use Netbeans as my IDE of choice. I first got into it when coding Java at university but since then I’ve moved into mainly working on PHP web apps and it has proved to be, in my opinion, the best PHP IDE available. In this post I’m going to highlight a couple of customisations I’ve made to make it’s use easier.

For the past couple of years I’ve used Netbeans on Ubuntu, previously I used Visual Studio on Windows but then I was developing C++ Applications. When I moved to Ubuntu I looked for a new IDE to patronise, I’ve never really got on with VIM or emacs.

Performance

Recently I’ve upgraded my main machine and it now has 16GB of RAM but netbeans was still sluggish, after reading around I found its memory parameters can be tweaked in config files. It should be noted that netbeans does attempt to auto tune itself on start-up for the amount of system memory but in my opinion it doesn’t do a great job. After much experimenting and breaking I came up with the following modification which seemed to make the whole system much more snappy:

The changes are made in the main netbeans config file, in Netbeans 7 that is:

/usr/local/netbeans-7.0/etc/netbeans.conf

Then change the default launch command line from:

# Options used by NetBeans launcher by default, can be overridden by explicit

# command line switches:

netbeans_default_options='-J.......'

to

# Options used by NetBeans launcher by default, can be overridden by explicit

# command line switches:

netbeans_default_options='-J-client -J-Xss32m -J-Xms1024m -J-Xmx1024m -J-XX:PermSize=128m -J-XX:MaxPermSize=512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Djava.net.preferIPv4Stack=true -Dsun.java2d.opengl=true -Dswing.aatext=true'

This change increases the amounts of memory available to netbeans on startup and thus things get much more responsive. The later parameters also try to improve font rendering.

This configuration could probably be tweaked more if I properly understood what I was doing but after breaking it I was just satisfied with a significant speed increase.

Formatting

I find the default font settings in netbeans too white, harsh on the eyes and also too bit so I’ve scaled down the font and added the solarized theme.

That changes the look from this:

Into this:

If you’re lazy you can download my preferences file here and install it in Tools>Options>Import

Other Stuff