6 Replies Latest reply on Oct 12, 2008 12:22 AM by sachin.parnami

    java.lang.OutOfMemoryError: PermGen space

    ajanz

      i use jboss 4.2.2 ga with seam 2.0.2 on windows 2003 server with jdk 1.6.04

      after hours i got

      java.lang.OutOfMemoryError: PermGen space

      is there a simple way in jboss to track memory allocation to identify where the problem comes from?

        • 1. Re: java.lang.OutOfMemoryError: PermGen space
          peterj

          You can use JConsole or VisualVM to track the permgen usage. I prefer JConsole because it causes less strain on the app server (VisualVM generates a lot of garbage on the app server which then has to be collected)

          You should set a larger permgen on the command line. Edit the run script, the line that sets the heap sizes in JAVA_OPTS and add -XX:MaxPermSize=256m (or larger).

          Also, are you doing development work with a lot of redeploys? A redeploy will generally eat up permgen space. If so, you should periodically restart the app server.

          • 2. Re: java.lang.OutOfMemoryError: PermGen space

            That means we should clean or undeploy it first and then deploy it. Will that thing helps, inspite of directly overriding deployment?

            • 3. Re: java.lang.OutOfMemoryError: PermGen space
              peterj

              No, undeploying the old version of the app first and then deploying the new version will not help because when you redeploy (in one step) the app server goes through the undeploy and deploy cycle for you. So you can still be using up permgen space. The only solution in this case is to restart the app server to free up the permgen space.

              • 4. Re: java.lang.OutOfMemoryError: PermGen space

                thanks :)
                So for that there is only solution and that is to increase the HEAP size. right?
                or there is any other solution to it?

                • 5. Re: java.lang.OutOfMemoryError: PermGen space
                  peterj

                  Yes, you can always increase the permgen size, but if you are constantly redeploying your apps, you will eventually run out of permgen space. Hot deployment, while handy for development, is not a panacea, it does have its side-effects. Of course, you could always try to determine if there is something about your app that is causing the permgen space to fill up.

                  • 6. Re: java.lang.OutOfMemoryError: PermGen space

                    Thanks Peter ;)