Getting rid of "java.lang.OutOfMemoryError: PermGen space" in Netbeans 7

In Netbeans 7.4 right click your tomcat server instance and choose properties in Services->Servers task pane:
Select the Platform tab and in the VM Options field set Permgen parameter.Put this code:
  1. -XX:PermSize=512m //512MB memory in this case
And click close.
If this still doesn't work.You can change netbeans.conf file :
Navigate to /etc/ directory in your netbeans installation directory:
Open the file netbeans.conf and look for a line like this:

  1. netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"

Add permgen parameter's here:
-J-XX:PermSize=512m -J-XX:+CMSClassUnloadingEnabled
Like this:
  1. netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=512m -J-XX:+CMSClassUnloadingEnabled -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"
Save and close the file.Restart netbeans.

No comments:

Post a Comment