7 Replies Latest reply on Feb 23, 2010 1:30 PM by peterj

    Out of memory occured on servlet.service()

    headiron

      Hi.

       

      Our company use jboss-4.0.2, and implement web service using jboss web service.

      Some times web service is hang up after OutOfMemberError.

      According to stacktrace message, OOM is occured during generate SOAP Response message.

      We want to find a solution prevent this issue.

      Is there any possible solution for it?

      ( We are using JAVA 5 VM 64.

        It is difficult to upgrade jboss because there is other service on it .

        But it is possible to upgrade jboss web service if it could prevent OOM )

      I also want to know how can I get a source of jboss web service executed on jboss4.0.2.

       

      Below is stack trace of OOM.

       

      02/22/2010 10:37:58,889 ERROR [[OaxApiBean]] Servlet.service() for servlet OaxApiBean threw exception
      java.lang.OutOfMemoryError: Java heap space
          at org.jboss.axis.message.SAX2EventRecorder$objArrayVector.add(SAX2EventRecorder.java:366)
          at org.jboss.axis.message.SAX2EventRecorder.startEntity(SAX2EventRecorder.java:180)
          at org.jboss.axis.encoding.DeserializationContextImpl.startEntity(DeserializationContextImpl.java:1349)
          at org.apache.xerces.parsers.AbstractSAXParser.startParameterEntity(Unknown Source)
          at org.apache.xerces.parsers.AbstractSAXParser.startGeneralEntity(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleCharacter(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
          at javax.xml.parsers.SAXParser.parse(Unknown Source)
          at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:257)
          at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
          at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
          at org.jboss.axis.Message.getContentType(Message.java:494)
          at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:971)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
          at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)

        • 1. Re: Out of memory occured on servlet.service()
          peterj

          What JVM agrguments are you setting? Have you monitored heap usage or garbage collection data? Does the data show a steady increase in heap usage, which could indicate a memory leak, or is there a sudden spike in usage?

           

          As for the sources, look in the manifest file with one of the web services jar file - that should tell you which version of web services it uses. Then look that version up on the downlaods page or in subversion. (I would be more specific but I don't have a copy of 4.0.2 at this time)

          • 2. Re: Out of memory occured on servlet.service()
            ropalka

            Hi Doochul,

             

               I highly recomend you to upgrade to AS 5.1.0.GA.

            There were many performance and memory leak fixes

            lately that might be blocking you. The most relevant one is:

            https://jira.jboss.org/jira/browse/JBWS-2486

            • 3. Re: Out of memory occured on servlet.service()
              headiron

              Hi Peter.

              Thanks for replying about this issue.

               

              Today, I add a jVM option, "-XX:+HeapDumpOnOutOfMemoryError", to get a heap dump to analyze heap memory usage.

              I got a heap dump by generate so big result.

               

              I made a result about 28.4MB sized, but heap size used by Message ( org.jboss.axis.Message  ) class is about 78MB .

              I don't understand why this class use heap memory so much.

               

              Can I get a source of Jboss Web service ? ( I wrote MANIFEST.MF on below )

               

              Thanks.

               

               

              Below is our condition used by web serivce.

                1. Web service implemented by "Stateless Session Bean".

                2. We use 64byte JVM ( J2SE 5.0 version provided by Sun)

                3. Web service is running on jBoss 4.0.2 AS

                4. Below is MAINFEST.MF on "axis-ws4ee.jar".

              Manifest-Version: 1.0
              Specification-Title: JBoss
              Created-By: 1.4.2_05-b04 (Sun Microsystems Inc.)
              Ant-Version: Apache Ant 1.6.2
              Implementation-Title: JBoss [Zion]
              Specification-Vendor: JBoss (http://www.jboss.org/)
              Specification-Version: 4.0.2
              Implementation-Vendor-Id: http://www.jboss.org/
              Implementation-Version: 4.0.2 (build: CVSTag=JBoss_4_0_2 date=20050502
              2023)
              Implementation-Vendor: JBoss Inc.
              Implementation-URL: http://www.jboss.org/

              • 4. Re: Out of memory occured on servlet.service()
                headiron

                Hi Richard.

                 

                Thanks for replying.

                 

                I have one question.

                 

                Did you recommend to upgrade jboss AS or JBoss Web Service ?

                ( It is difficult to upgrade jboss AS because there are other service on jboss engine. )

                 

                I have one more question.

                 

                Can I use Axis2 on jBoss4.0.2AS?

                 

                Thanks

                Doochul.

                • 5. Re: Out of memory occured on servlet.service()
                  ropalka

                  Hi Doochul,

                   

                     I suggested you to upgrade both JBossAS and JBossWS

                  See our matrix to see what JBossWS version is targeted for which JBossAS.

                  I don't know if you can run Axis on top of JBossAS 4.0.2

                  Let's see what our users will reply.

                  • 6. Re: Out of memory occured on servlet.service()
                    peterj

                    As I feared, the manifest doesn't give a clue as to the JBossWS level (manisfests for newer versions of JBossAS are better at identifyiong the version of the component). And the link that Richard provided doesn't help either because it does not go back far enough. Let me see if I have a copy of 4.02 somewhere and if I can figure out which version of JBosWS it uses.

                     

                    If you cannot reduce the memory usage, your only other option is to increase the max heap size. You will want to do that anyway as a temproray measure while you research other options.

                    • 7. Re: Out of memory occured on servlet.service()
                      peterj
                      Ah, looking at the AS 4.0.2 source it appears that the webservices source is included in the webservice directory.