Netbeans is my IDE of choice but the resources it commands sometimes cause my machine to choke like the Cleveland Browns on any given Sunday.
Here is what I’ve done to improve the situation a bit:
Nutshell: edit the netbeans conf file to increase the amount of memory allocated and permitted
You’ll be editing the netbeans conf file which, on my Mac and under version 6.7, is located in /Applications/NetBeans/NetBeans\ 6.7.app/Contents/Resources/NetBeans/etc/netbeans.conf The way I handled this was to open the file, copy the chunk that handles configuration (so I have a backup of the original settings), comment the old settings out and then make my changes.
The original settings (notice the pound sign at the start indicating this is commented out):#netbeans_default_options="-J-Dcom.sun.mysql.startcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.stopcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.startargs=start -J-Dcom.sun.mysql.stopargs=stop -J-Dcom.sun.mysql.port=3306 -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
My new settings:netbeans_default_options="-J-Dcom.sun.mysql.startcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.stopcommand=/usr/local/mysql/support-files/mysql-admin.server -J-Dcom.sun.mysql.startargs=start -J-Dcom.sun.mysql.stopargs=stop -J-Dcom.sun.mysql.port=3306 -J-client -J-Xss2m -J-Xms256m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
Changes include:
| Old | New |
|---|---|
| not set | -J-Xmx512m |
| -J-Xms32m | -J-Xms256m |
Some definitions… the -J-Xms setting defines the initial memory size, -J-Xmx defines the maximum.
You could set these numbers higher if you have more RAM but going too high can cause instability. One way to determine how much memory Netbeans is using is to turn on View->Toolbars->Memory. This will give you some feeback on how much you are actually using.





