Is your Netbeans running slower? Try this trick.
Posted by Bhushan G Ahire | Posted in General | Posted on 26-07-2010
0
I use NetBeans 6 all the time on my 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 jdk6 update 17.
And even this should work for NetBeans 6, this should work on any platform.
on MAC/Linux/Windows 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.
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.
