How to kill NetBeans performance
There are several things you can do that will have a *huge* impact on NetBeans IDE performance and responsiveness.
The single biggest thing you can do is to make sure your "userdir" is not on a remote file system, (i.e. NFS, samba drive, etc).
What is "userdir" ?
It is a directory where NetBeans IDE stores its meta-data. One of the critical pieces of meta-data stored there is the information used for those productivity enhancing features we all enjoy such as code completion.
By default NetBeans IDE creates "userdir" in your home directory as a ".netbeans" directory with an appended NetBeans IDE version number. Hence, if you are on Linux or Unix, "userdir" is $HOME/.netbeans/
If your home directory happens to be a remote file system ... well, we all know performance of a remote file system is not nearly as good as local file systems. And, if your remote file system's responsiveness is like some that I have seen ... it will kill the responsiveness of your NetBeans IDE.
The good news is you can change the location of "userdir". You can specify a "userdir" on the command line when you start NetBeans IDE such as:
$ netbeans --userdir /local/file/system/netbeans/userdir/5.0
Or, you can edit the netbeans.conf file and change the "userdir" location to a local file system. The netbeans.conf file is in < netbeans install dir>/etc.
To make editing of the netbeans.conf easier, Claudio Miranda created nice plugin. Claudio would be glad to share his plug-in. Just drop him a note. Or, perhaps we can convince Claudio to contribute it to the many plug-ins showing up on nbextras.org.
For additional responsiveness, you should also consider using a JDK that is on a local file system too. Code completion in NetBeans IDE uses the JDK's src.zip for displaying Java doc information, (a nice way to ensure you have the latest Java doc for the JDK).
Putting NetBeans projects on local file systems helps too.
Posted at 03:17PM Apr 19, 2006 by charliebrown in Java | Comments[7]
Posted by MNO on April 20, 2006 at 02:14 AM CDT #
What JDK version are you using and what JVM command line args are you using?
I am using Sun's JDK 1.5.0_06 with these JVM args:
-Xms256m
-Xmx512m
-XX:+UseConcMarkSweepGC
-XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenPrecleaningEnabled
-XX:PermSize=64m
-XX:MaxPermSize=96m
-Xverify:none
I'm using a rather larger Java heap as a result the large project, (4000+) files. Be careful not to set your Java heap too large, it will force part of your Java heap into virtual memory. Doing a GC on a Java heap which has part of it in virtual memory will kill its performance. I have 1G of RAM on my system. How much do you have on yours ?
Posted by charliebrown on April 20, 2006 at 08:19 AM CDT #
Posted by MNO on April 20, 2006 at 09:18 AM CDT #
Is this with your source files local or remote ?
On Windows ? Is it XP Pro, XP Home? Or, is it Linux ?
Can you also add, -J-XX:+PrintGCDetails to your command line args in netbeans.conf ?
If you are on Windows, you'll need to run nb.exe from the command line. It's in 'install dir'/bin. If you're on Linux/Unix, you can just run 'install dir'/bin/netbeans.
Then, when you are doing code completion for attributes or methods, tell me what the max GC time. I want to be able to rule out GC as a cause. If you'd like to save the output to a file and e-mail it to me that would be great too. I'm huntch at netbeans.org.
Out of curiousity, I'd be interested in knowing if you could try the latest JDK 6 build, http://java.sun.com/javase/6/download.jsp.
You can still set you project to use JDK 5 as the platform, (right click the Project and select Properties and then under Libraries click Manage Platforms and add JDK 5), you'd just be running the IDE with JDK 6. Use the same JVM command line args for JDK 6 as you have now.
Posted by charliebrown on April 21, 2006 at 09:24 AM CDT #
Posted by charliebrown on April 21, 2006 at 05:06 PM CDT #
Posted by mauronr on April 26, 2006 at 12:01 PM CDT #
Posted by Jean-Marie White on April 26, 2006 at 12:24 PM CDT #