I didn't use NetBeans very often, but I do use it often now because I need to work on some Swing application. Sometimes, I saw PermGen space OutOfMemoryError and similar to IntelliJ IDEA, I can change the JVM options for NetBeans to get rid of this error.
First, find where is the configuration file:
$ locate netbeans.conf
Then, add the following line to netbeans.conf
-XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled