9 Replies Latest reply on Aug 30, 2007 4:36 PM by Brian Smith

    PermGen Space reaching Maximum Limit

    Yogesh Novice

      I had a problem with Out of Memory exceptions ... This was supposed to be addressed by the following :

      http://opensource.atlassian.com/projects/hibernate/browse/HHH-2481


      From the Comments, someone even suggested that there was some performance gains too ...


      A post on JBoss Forums further indicated that this was a bug with hibernate :

      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039784#4039784


      So i did the necessary upgrades for Javassist and Hibernate 3.2.3.GA and started doing some profiling using JProfiler ....

      I have set the perm gen size to 256M


      While i can say that i did not get any Out of Memory leaks till now ... I could see the used Heap size getting dangerously near the maximum perm gen space at times .... Besides, the web application tends to be a slow when the perm gen space reaches these levels ....


      I would like to know what further improvements i can bring so that the used heap size remains at an acceptable level and how can i improve the performance of the web app in general

      I am using EJB 3.0, Hibernate 3.2.3.GA, Seam 1.1.0CR1, JSF/Facelets, MySQL 5.0 ..

      I have a relatively small web application with around 73 SFSB which are not using conversations and 78 SLSB and 43 Business objects


      I really need help on this because the application is already in production and we are really having problems


      Regards,
      Jankee Yogesh
      Software Developer
      M-ITC LTD

        • 1. Re: PermGen Space reaching Maximum Limit
          Tom Goring Apprentice

          Hi,

          We have 50 EJB3 beans and had this issue. I guess you read my post on this about how we fixed it ?

          Running jstat on our app now levels out at about 50MB (put we need to prime the VM with about 70MB at start up).

          Are you sure you patched the jboss as per my script ?

          Also can you confirm that in production your not doing hot deployments.

          • 2. Re: PermGen Space reaching Maximum Limit
            Yogesh Novice

            Hello ...

            Could you please give me a link to your post ... I can affirm that no hot deployments are done in production .


            Regards,
            Jankee Yogesh,
            Software Developer,
            M-ITC LTD

            • 3. Re: PermGen Space reaching Maximum Limit
              Yogesh Novice

              Hello ...
              I suppose you are mentioning about your reply in the topic i started ... I dont know if i patched the jboss well .. Could you please guide me from where you got the libs ..

              I downloaded Javassit 3.4 and the latest libs from Hibernate including hibernate core, annotations ...etc and replaced them in jboss client and server/default/lib


              Is there a patch containing all libs and an ant script which i can run ?


              Btw, since this is a known hibernate issue which is supposedly fixed, should upgrading to the latest Hibernate version not fix this ?

              Also, I have no OOM leaks so far, but the used heap size gets to dangerous levels during my profiling test with JProfiler and slows down the server ... Its this behavior that freaks me out

              Thnx for helping ...


              Regards,
              Jankee Yogesh
              Software Developer,
              M-ITC LTD

              • 4. Re: PermGen Space reaching Maximum Limit
                Udo Krass Newbie

                Hi,

                i have the PermGen Space problems very often. I've found a german site with a solution:
                http://blog.meimberg.info/?p=207
                It means that you shoud start your JBoss with

                set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m
                -XX:+CMSPermGenSweepingEnabled -XX:MaxPermSize=128m
                -Dsun.rmi.dgc.client.gcInterval=3600000
                -Dsun.rmi.dgc.server.gcInterval=3600000

                Now the PermGen Space error only appears after about 10 hot deployments.
                And it is recommended to use BEA Rocket VM. But i think that isn't the best way...

                But i want to know, how JBoss Seam manages the hot deployment in a productive environment. I dont want to stop my server for every new version. Will the webaap be stable at a hot deployment?

                • 5. Re: PermGen Space reaching Maximum Limit
                  Christian Bauer Master

                  Folks, there is a section in the Seam documentation with the recommended PermGen size settings for Seam development and hot deployment. I have used these settings in production with JBoss AS 4.2 RC2 for a while and redeployed my application many times. Note that the original poster does not have an actual problem, he just asks what he can do to improve the memory footprint in general.

                  • 6. Re: PermGen Space reaching Maximum Limit
                    Yogesh Novice

                    My actual problem is in fact Out of Memory Leaks that is supposed to be fixed with the patch suggested in

                    http://www.jboss.com/index.html?module=bb&op=viewtopic&t=107032


                    Though, i am not getting any memory leaks after 1 1/2 day in production so far ... i cannot confirm that the problem is solved ...


                    Because, the amount of used heap space that is being used at times is simply unacceptable for me and the fact that the response time decreases when so much memory is used is also posing problems .... I cannot afford such slow response times...


                    It is highly likely that these problem are related if not the same !! ..... Perhaps changing the garbage collection interval can help .... Have to test it though ....


                    Thnx for your suggestions folks ...


                    Regards,
                    Jankee Yogesh,
                    Software Developer,
                    M-ITC LTD

                    • 7. Re: PermGen Space reaching Maximum Limit
                      Alexei Novikov Newbie

                      I experimented hot deploying jboss-seam-booking demo to the standard installation of jems-installer-1.2.0.GA (JBoss 4.0.5)
                      I tried Seam 1.1.6.GA and 1.2.1.GA; in both cases I observed growing allocated PermGen memory, a growing number of loaded classes, and finaly OutOfMemory.

                      • 8. Re: PermGen Space reaching Maximum Limit
                        Dave Everson Newbie

                         

                        there is a section in the Seam documentation with the recommended PermGen size settings for Seam development and hot deployment.


                        I looked in the documentation and I don't see these recommendations. Is there a link or clearer reference to this section?

                        • 9. Re: PermGen Space reaching Maximum Limit
                          Brian Smith Apprentice

                          See here
                          http://docs.jboss.com/seam/2.0.0.B1/reference/en/html_single/#d0e2116

                          Of course if you are using Windows you will have to alter bin/run.bat instead of bin/run.conf like recommended in the docs because that is for Linux/Unix