Kelly O'Hair's Weblog (blogs.sun.com)
Why is NetBeans so slow? Here is a tip.
I use NetBeans 6 all the time on my Mac laptop and have learned how to configure it to run more effectively for me. NetBeans, like any Java application needs room to work, and the default memory settings for Java and NetBeans are usually not what I consider ideal. Of course how would they know what is ideal, you need to tell it. Granted my solution may not be ideal for others, but it's worth playing with. I'm using jdk5 update 13 on my Mac, but these same setting should apply to jdk6 also. And it's not just for The Mac or even NetBeans 6, this should work on any platform.
KellyMacBook<3> cat ~/.netbeans/6.0/etc/netbeans.conf
netbeans_default_options="-J-Xms256m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m
-J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled"
Any change to this file will require a reboot (there should be one line in the file above, I had to break it up to get the blog to display it in a readable way).
Also, turn on the View->Toolbars->Memory to keep track of the NetBeans memory usage, clicking on it will force a GC, and you can get a feeling for how much memory your NetBeans session needs, making adjustments to the maximums above. And my recommendation is that the maximum (-J-Xmx) setting should never be more than the RAM on the machine minus 512m, or system memory thrashing may occur.
Additional information can be found at the NetBeans FAQ on GC pauses and the NetBeans FAQ on configuration.
The above settings make a world of difference in the way NetBeans performs for me.
-kto
Posted at 12:06PM Feb 29, 2008 by kto in Java | Comments[6]
Friday Feb 29, 2008




Add the
-J-Xverify:none
option also for even more speed.
Posted by 194.117.20.2 on February 29, 2008 at 12:30 PM PST #
Hi Kelly,
For even greater performance, run NetBeans on Linux :-) It's very snappy on modest platforms.
Cheers,
Cay
Posted by Cay Horstmann on March 01, 2008 at 09:10 PM PST #
Or, you may try Landon Fuller's SoyLatte.
Posted by Weijun on March 02, 2008 at 05:56 AM PST #
Thanks for the tips, as this has helped considerably. Though I used four times your memory values since this system has 8Gb RAM. Also of note, my NB 6.0 (Build 200711261600) config file is named "app.conf" instead of "netbeans.conf".
Posted by Wes W. on March 02, 2008 at 07:32 AM PST #
NB 6.1 beta looks promising, but it looks like this change does not work because ~/.netbeans/6.1beta/etc does not exist. How can I apply this in this case?
Posted by Eric Wendelin on March 06, 2008 at 08:39 PM PST #
Ok so it turns out I can just create the etc directory and it works...sorry I should have tried that first.
Posted by Eric Wendelin on March 06, 2008 at 08:42 PM PST #