For Windows - Should work for other OS as well
Netbeans is just like any other java application which requires tuning for its JVM.
Please read the following link to have some benchmark results for netbeans
https://performance.netbeans.org/reports/gc/
The following settings works fine in my Windows 7 PC with 4GB RAM and I5 Quad core processor.
(Check for the line netbeans_default_options in the netbeans config file inside bin folder and replace the config line as follows)
netbeans_default_options="-XX:TargetSurvivorRatio=1 -Xverify:none -XX:PermSize=100M -Xmx500m -Xms500m -XX+UseParallelGC ${netbeans_default_options}"
Small Suggestion: Garbage collection plays a vital part in JVM heap size and since I had a quad core processor, I used Parallel GC. If you have single thread processor, please use UseSerialGC. From my experience, if Xmx Xms values are same, there is no performance overhead for JVM to switch between min and max values. In my case, whenever my app size tries to exceed 500MB, the parallel GC comes in handy to cleanup unwanted garbage so my app never exceed 500MB in my PC.