1 Reply Latest reply on Sep 18, 2013 4:55 AM by redcar

    Memory and Handles with JAX-WS in JBoss 5.1.0 GA

    redcar

      Hallo,

       

      I have deployed an very simple Webservice in JBoss 5.1.0 GA as @Stateless EJB.

       

      @WebService()

      @Stateless()

      public class WSAny

      {

       

        /**

         * Web service operation

         */

        @WebMethod(operationName = "searchCity")

        public Stadt searchCity(@WebParam(name = "name")

        String name)

        {

          Stadt stadt = new Stadt();

          stadt.setName("Nowhere");

          Verkehrssystem v = new Verkehrssystem();

          stadt.setVerkehrssystem(v);

          v.setId(23);

          Buergermeister b = new Buergermeister();

          b.setName("Ole");

          v.setInfrastruktur(b);

         

          return stadt;

        }

      }


      The client was built with Netbeans 7.3.1 and I can access the webservice without any problem.


      After this I expanded the TestClient to 100 Threads, which are calling the Webservice every 600 ms.

      At the most time, the calls have no problem, but sometimes I will get server side exceptions:


      12:31:25,176 ERROR [SOAPFaultHelperJAXWS] SOAP request exception

      org.jboss.ws.core.CommonSOAPFaultException

              at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:93)

              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:294)

              at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:193)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:455)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)

              at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

              at java.lang.Thread.run(Thread.java:619)

      12:31:25,176 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception

      javax.xml.rpc.soap.SOAPFaultException

              at org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC.exceptionToFaultMessage(SOAPFaultHelperJAXRPC.java:189)

              at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.exceptionToFaultMessage(SOAPFaultHelperJAXWS.java:183)

              at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.createFaultMessageFromException(SOAP11BindingJAXWS.java:102)

              at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBinding.java:671)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:496)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)

              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)

              at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

              at java.lang.Thread.run(Thread.java:619)

       

      The client will get this Exception after this error:


      ----> 2) Exception in TestAnyType.searchCity:

      javax.xml.ws.soap.SOAPFaultException: Unqualified {http://schemas.xmlsoap.org/soap/envelope/}Client fault

              at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)

              at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)

              at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)

              at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)

              at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)

              at $Proxy29.searchCity(Unknown Source)

              at org.wh.any.client.test.TestAnyType.searchCity(TestAnyType.java:67)

              at org.wh.any.client.test.TestAnyType.access$100(TestAnyType.java:15)

              at org.wh.any.client.test.TestAnyType$SearchRunner.run(TestAnyType.java:102)


      This is one problem, but I have another one, which is much more alarming.

      I use jdk1.6.0_20 32 bit edition.on Windows 8.

      The program is running 60 minutes good. After this time, the server beginns to raise memory and the handles of the process, which can be seen inside the taskmanager. I have made a statistic file for documention to this error:


      SearchCITY

       

      - 100 Threads ; Intervall 600 ms

      -> sometimes SOAPFaultExceptions

       

      [time memory usage:handles]

      11:15 511.868:764

      starte Threads:

      11:15 626.892:1.655

      11:40 439.100:1.702

      12:00 779.251:1.740

      12:15 770.812:1.779

      12:30 1.183.288:414.512

       

      I have this problem inside every Webservice application with this application server and a lot of client calls.

      This application is a very simple test programm only, to show the problem in a simple way.

      Also if I shutdown the clients. the memory and handles of the server are not reduced any more.

      The application will run, until the operating system runs out of recources.


      Inside the file ~/server/default/deploy/jbossweb.sar/server.xml I have raised the maxThread property:


      <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"

                     connectionTimeout="20000" redirectPort="8443" maxThreads="350" />

       

      This I have needed, because with the standard size of 200, the webservice do not respond in fast way,

      if I have very much clients, wich are calling the webservice.


      I have tried also othe JDK:

      jdk1.6.0_45_x64

      jdk1.6.0_04

      jdk1.6.0_20


      with jdk1.6.0_45_x64 the problems are much more worse then with jdk1.6.0_20.


      What can I do, to fix these problems?


      Best regards,

      Werner

        • 1. Re: Memory and Handles with JAX-WS in JBoss 5.1.0 GA
          redcar

          I realized, that I have a lot of open Finalizers in conjunction with ZipEntryContext.

           

          The solution is:

          conf/bootstrap/vfs.xml:

          Cange the bean class used for property name="realCache"

          from "org.jboss.virtual.plugins.cache.IterableTimedVFSCache" to

          "org.jboss.virtual.plugins.cache.TimedVFSCache".

           

          Now I realized another problem:

          WEB: http://localhost:8080/status?full=true

          here I can see:

           

          Start time: Wed Sep 18 08:12:43 CEST 2013

          Startup time: 0 ms

          TLD scan time: 0 ms

          Active sessions: 10174

          Session count: 29610

          Max active sessions: 10201

          Rejected session creations: 0

          Expired sessions: 19438

           

          The count of active session is allways growing. Why?

          What do I have to to to close active sessions?