6 Replies Latest reply on Jul 11, 2007 4:12 AM by Alexei Novikov

    Out of Memory Leaks

    Yogesh Novice

      Hi All,
      I have a web application which is in production and uses the following technologies :


      EJB 3.0
      Hibernate
      Seam
      JSF
      Facelets
      Ajax4JSF

      MySQL 5.0



      I am using JDK 1.5.0_09


      I have around 73 SFSB which are not using conversations and 78 SLSB and 43 Business objects.


      In production, there are four users which are connected simultaneously. The HTTP and EJB Session timeout is set to 4 hours .....


      However, the server has to be restarted at least twice a day due to OUT OF MEMORY leaks associated to Permgen space ..... I was getting this problem during development previously but increasing the permgen space to 256M solved this issue ...


      I am not sure that implementing conversations only would solve my problems .... Can anyone have other suggestions on what could be wrong. This is really posing a huge problem for me



      Cheers,
      Jankee Yogesh
      Software Developer
      M-ITC LTD










        • 1. Re: Out of Memory Leaks
          Jim Hazen Expert

          Try using JRocket. Permgen issues are tricky and are a real problem for apps like yours that load and reload a zillion classes. Someone else can probably go into the details but JBoss isn't alone, for a quick fix grab the latest R27.2 JRocket release. JRocket handles permgen differently than Sun's JVM. No settings to tweak and generally no permgen problems either. Be sure and grab the latest, I had problems with the prior version.

          • 2. Re: Out of Memory Leaks
            Yogesh Novice

            Hi ,
            Thnx for this tip ... Can i have a link to this jrocket ? Thnx again

            • 4. Re: Out of Memory Leaks
              Juraj Holtak Newbie

              we also had PermGen problems

              Can confirm that JRocket helps with PermGen problems.

              You could try SUN JVM 1.6.0 update1 - it suspiciously works here untill now but maybe the server wasn`t just stressed enough and there seams to be no significant change in the SUN changelog regarding this issue...

              • 5. Re: Out of Memory Leaks
                Tom Goring Apprentice

                Hi,

                We had this issue in production.
                For us it was a bug in hibernate and java assist when using remote interfaces to the SLSB's.

                The fix is to replace javaassist.jar and hibernate jars in jboss.

                We used javaassist 3.4 and hibernate 3.2.3.ga.

                Hope this helps.


                Here is our patch script.

                 <copy file="../JNET-LIBS/jboss-patch/javassist.jar" todir="${jboss.home}/client"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate3.jar" todir="${jboss.home}/client"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate-annotations.jar" todir="${jboss.home}/client"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate-commons-annotations.jar" todir="${jboss.home}/client"/>
                 <copy file="../JNET-LIBS/jboss-patch/javassist.jar" todir="${jboss.home}/server/default/lib"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate3.jar" todir="${jboss.home}/server/default/lib"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate-annotations.jar" todir="${jboss.home}/server/default/lib"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate-commons-annotations.jar" todir="${jboss.home}/server/default/lib"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate-entitymanager.jar" todir="${jboss.home}/server/default/lib"/>
                 <copy file="../JNET-LIBS/jboss-seam-1-1-6-lib/hibernate-validator.jar" todir="${jboss.home}/server/default/lib"/>
                


                • 6. Re: Out of Memory Leaks
                  Alexei Novikov Newbie

                   

                  "holtak" wrote:
                  we also had PermGen problems

                  Can confirm that JRocket helps with PermGen problems.

                  You could try SUN JVM 1.6.0 update1 - it suspiciously works here untill now but maybe the server wasn`t just stressed enough and there seams to be no significant change in the SUN changelog regarding this issue...



                  We also tried JRocket and are using it now in development and testing environment. It really solves the PermGen issue because there is no separate Permanent Generation of a garbage collectable memory in JRockit JVM, but it does not solve memory leaks that exist in somewhere in container or application code. Memory still leaks, the allocated heap grows, and after all, OutOfMemory condition still occures, though the system survives many more hot deploy cycles.

                  The ultimate solution to the problem would be an application and an application container that do not leak memory. The problem is there, not in the Java VM, or the memory configuration parameters. The system is leaking - it will crash sooner or later no matter what JVM or how much memory is configured.