3 Replies Latest reply on Sep 29, 2008 4:00 PM by Peter Johnson

    PermGen space

    Thiago Costa Newbie

      Hi People

      i'm having problems with "PermGen space". Actually, i'm using jboss 4.0.3sp1 with jdk1.5.0_12 for win 32bits.

      I use my application normally during some days, but after few days this problem happen with me: "java.lang.OutOfMemoryError: PermGen space"

      I was looking for something that can help me to solve this and i know that if i upgrade the memory allocated for the JVM this problem can be solve, but, i don't have enough space to do this.

      I would like to know if exist something to do in this case. Maybe getting free space in PermGen...

      Somebody can help me?


        • 1. Re: PermGen space
          Peter Johnson Master

          In a typical application, the permgen will grow to a certain size and then stay at that size for the rest of the app run. Some of the reasons that the pergen size will increase are:

          * Deploying a new application
          * Redeploying an application
          * Accessing new functionality within an application

          If you find that you are redeploying applications often, then you will need to periodically restart the app server.

          The JVM will remove unneeded class definitions from the permgen during a garbage collection, but sometimes classes in an old version of an application still hang around even after a new version has been deployed, hence the increase in permgen size.

          If you are not redeploying applications, then you need to monitor the permgen size (use JConsole or a similar tool) and when you see a permgen increase you need to figure out what was going on at that time.

          • 2. Re: PermGen space
            Thiago Costa Newbie

            Hi Peter

            I'm really thankful with your attention.

            Then, the only form that i have to get free space in PermGen is restarting the app server or upgrade the PermGen size.... is this?

            I can't force GC on the PermGen?

            Do you know if in these news versions, this problem is fix?

            What do you recommend?


            • 3. Re: PermGen space
              Peter Johnson Master

              As I already mentioned, the permgen is automatically garbage collected with unused classes being removed. The issue is that there are many situations where you believe that classes should not be in use but in fact they really are. Once you determine why the permgen is increasing in size, then you can put together a plan of action, with restarting being one of the possible options.