7 Replies Latest reply on Mar 19, 2008 7:49 PM by theute

    PermGen Space

    patrickdalla

      Hi,

      I am frequently seeing OutOfMemoryException with PermGen space description.

      I'm using Jboss-Portal and MyFacesPortlet. Don't know which is causing the problem.

      How can I avoid this?

        • 1. Re: PermGen Space
          schnelzer

          In your run.bat or run.sh try setting the MaxPermSize and PermSize to 128m. We did this and its seems to have solved the issue for us. The setting are -XX:PermSize=128m and -XX:MaxPermSize-128m. The are some tools in JDK 1.5 bin directory if you are using 1.5 that are helpful.

          • 2. Re: PermGen Space
            khalidhafeez

            Hi,
            Could u please let me know at which place it should be written in run.bat ?
            thanx

            • 3. Re: PermGen Space
              emuckenhuber

              You could also use the JAVA_OPTS in the bin/run.conf, which is maybe easier to find.

              • 4. Re: PermGen Space
                bdaw

                In the AS /bin directory look for the run.conf file. You need to make it:

                if [ "x$JAVA_OPTS" = "x" ]; then
                 JAVA_OPTS="-Xms128m -Xmx512m -XX:PermSize=128m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
                fi



                • 5. Re: PermGen Space

                  Hi patrickdalla,

                  take a look at my blog, there I explained how to solve the java.lang.OutOfMemoryError: PermGen space problem.

                  • 6. Re: PermGen Space

                    The problem appears due to hibernate consuming a lot of perm gen!

                    It should be in a wiki, release note, documentation - or even set by default - but it is not :-(

                    To fix MaxPermSize :

                    in jboss server, customize the "run.bat" file

                    set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1274m -XX:MaxPermSize=256m -Dcom.sun.management.jmxremote


                    To fix it within eclipse, use 3.3.1 or above, and customize the eclipse.ini file to include something like that

                    -showsplash
                    org.eclipse.platform
                    --launcher.XXMaxPermSize
                    256m
                    -vmargs
                    -Xms40m
                    -Xmx512m

                    • 7. Re: PermGen Space
                      theute