5 Replies Latest reply on Apr 11, 2006 9:15 AM by Marc-Christian Wimmer

    Multiple redeployment gets PermGen error

    fmaredia Newbie

      We have a fairly large application that is deployed as an ear. It contains ejb jars, har, war, and some important jars. After a couple of redeployments we get a PermGen error stating that we have run out of memory. This problem only exists after a certain number of redeployments. Our existing Non-Heap memory (Perm Gen) was set to 64MB so I extended it to 128MB. Now it takes twice the amount of redeployment before we run into the memory problem. I was wondering if there is a solution to this? I looked everywhere and the only solution I found was to increase the Perm Gen memory. Is JBoss aware of the problem?

        • 1. Re: Multiple redeployment gets PermGen error
          Peter Salomonsen Newbie

          I have the same setup and the same problems. I deploy an ear in exploded form containing ejb3, sar and war. I use to redeploy by touching META-INF/application.xml. After redeploying a number of times I get the PermGen space error.

          When PermGen error occurs JBOSS is not able to do a controlled shutdown. Neither is a normal process kill enough. Only a kill -9 does the job.

          This is very annoying because a restart of JBOSS means at least 5 min down time.

          Best regards,

          Peter Salomonsen

          • 2. Re: Multiple redeployment gets PermGen error
            echoi1975 Newbie

            we are having the smae problem, and our app is only 4 MBs, i'm wondering if we should do more heavy duty profiling to look for memory leaks, and we already did a once over on the code, and did not find anything to lead us believe we have memory leaks. we were thinking about bumping up the vm memory allocation...but wanted to hear what other ppl think as well..

            • 3. Re: Multiple redeployment gets PermGen error
              Peter Johnson Master

              The permanent generation holds class-level data (that is, any fields defined as static). My guess that your classes contain static data, and when you redeploy, the redeployed classes are loaded by a new class loader and thus the static data from the old classes and the new classes are now taking up room. Do this several times and the permanent generation will fill up. If my guess is correct, the solution would be to modify your code to not use static data in any of your classes. Of course you should also check any class libraries on which your code depends (jar files you package with your ear) for the same thing. But then I could be wrong.

              • 4. Re: Multiple redeployment gets PermGen error
                David Schlotfeldt Newbie

                I have the same issue. It is a lare issue. If I am reading this correctly.. there is nothing we can do except change how we code things and the code of any libraries we are using?

                I'm confused on the status of this. I see that the ticket was for this issue but nothing done about it. Is work going to be done to take care of it or is there nothing that can be done?

                • 5. Re: Multiple redeployment gets PermGen error
                  Marc-Christian Wimmer Newbie


                  i had the same problem.

                  i don't know if it is solved yet - somebody said to me that there are issues with linux kernel greate 2.4.

                  i had to insert the following line inth the .bashrc of the user running the jboss:

                  with that it should work....can somebody please try it out and tell if it works?