5 Replies Latest reply on May 15, 2007 3:34 AM by m m

    Redeploying Ajax4jsf application causes java.lang.OutOfMemor

    m m Newbie

      Hi all,
      here's what happens:

      - If i include Ajax4Jsf support (filter + filter-mapping in web.xml) i get an OutOfMemoryError after redeploying the war file about 10 times.
      - If i keep the libraries but exclude the configuration in web.xml, i don't get errors.
      - In my server/[custom]/tmp directory i can see several folders named like my web-app, containing only WEB-INF/lib/ajax4jsf-1.1.0.jar file, which cannot be deleted. During jboss shutdown i get the message "Failed to delete dir: tmp/appname.war"

      I read about jboss redeploying problems, but the workarounds didn't help me.

      Anyway, the web-app is working fine, but i cannot restart Jboss each X deploys ;)

      I suppose some ajax4jsf resources are not released, causing the problem (seen also with JProfiler tool).

      Thanks a lot for any help


        • 1. Re: Redeploying Ajax4jsf application causes java.lang.OutOfM
          Juan Ignacio Sánchez Lara Apprentice

          I've read about many servers memory leaks problems. I'm facing the same issue with Sun App Server. It seems not to be a better solution other than restarting

          • 2. Re: Redeploying Ajax4jsf application causes java.lang.OutOfM
            Wolfgang Klaus Newbie

            I also had problems with OutOfMemory. After reading something in
            the web I gave JRockit from BEA [1] a try. With this VM the errors are
            gone. I didn't got the OutOfMemory errors any more.


            [1] http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/jrockit/

            • 3. Re: Redeploying Ajax4jsf application causes java.lang.OutOfM
              m m Newbie

              Here's the tree allocation in JProfiler, after undeploying the application.
              I'd like to understand if it's just a problem i have or if it's a known issue, because i don't think i made anything wrong in my app.

              Thanks for replies

              93,7% - 15.792 bytes - 749 alloc. org.apache.tomcat.util.net.MasterSlaveWorkerThread
              ..93,7% - 15.792 bytes - 749 alloc. org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter
              ....92,3% - 15.544 bytes - 741 alloc. org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter
              ......83,6% - 14.080 bytes - 674 alloc. org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyXMLFilter
              ........83,6% - 14.080 bytes - 674 alloc. org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser
              ..........83,6% - 14.080 bytes - 674 alloc. org.ajax4jsf.org.w3c.tidy.Tidy
              ............24,8% - 4.176 bytes - 156 alloc. org.ajax4jsf.org.w3c.tidy.TagTable
              ............24,0% - 4.048 bytes - 253 alloc. org.ajax4jsf.org.w3c.tidy.EntityTable
              ............22,8% - 3.840 bytes - 173 alloc. org.ajax4jsf.org.w3c.tidy.AttributeTable
              ............12,0% - 2.016 bytes - 92 alloc. org.ajax4jsf.org.w3c.tidy.Configuration
              ......8,0% - 1.344 bytes - 59 alloc. org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper
              ........5,0% - 848 bytes - 37 alloc. org.ajax4jsf.io.parser.FastHtmlParser
              ..........5,0% - 848 bytes - 37 alloc. org.ajax4jsf.io.parser.ParsingStateManager
              ............2,9% - 496 bytes - 22 alloc. org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser
              ............2,9% - 496 bytes - 22 alloc. org.ajax4jsf.org.w3c.tidy.Tidy
              ..............1,6% - 264 bytes - 11 alloc. org.ajax4jsf.org.w3c.tidy.Lexer
              ..............1,4% - 232 bytes - 11 alloc.

              • 4. Re: Redeploying Ajax4jsf application causes java.lang.OutOfM
                Sergey Smirnov Master

                There are two issues there:
                1. TidyParser requires some amount of memory to work
                2. Server has a memory leak due its own bugs

                About #1. TidyParser needs memory to work. The required amount that is proportional to the size of processed pages. Just allocate more memory to solve the problem.

                About #2. Each server has its own way how to fight with this silent killer. However, reboot is universal way.

                P.S. Working with livedemo.exadel.com (Tomcat 5, Linux) I have realized that the most painful action for it is updating the application with a new version. Sometimes, it requires not only rebooting, but cleaning cache to avoid unexpected glitches

                • 5. Re: Redeploying Ajax4jsf application causes java.lang.OutOfM
                  m m Newbie

                  Maybe moving myFaces and ajax4jsf libraries outside the webapp will solve the problem.
                  Is it better to put them inside the "jbossweb-tomcat55.sar/jsf-libs" folder or inside the "server/default/lib" folder?