1 Reply Latest reply on Mar 30, 2012 4:58 AM by Bryan Brouckaert

    Memory leak when using @WebServiceRef

    Bryan Brouckaert Newbie



      We have a large number of ears (about 100) and 3 of them use web services via the WebServiceRef annotation on the service (but the problem remains the same if setting on the port).  After about 1 day of intensive usage, we get a out of memory exception and the 3 ears with web service ref are responsible for more then 50% of the memory usage.


      I analysed the memory and it seems that the each call to the EJB containing the @WebServiceRef is kept in the ThreadLocalPool (an InfinitePool) of the StatelessContainer.


      Does anyboy know why this happens and more importanly, does anybody know how to solve it?


      Kind regards,


        • 1. Re: Memory leak when using @WebServiceRef
          Bryan Brouckaert Newbie

          I investigated furtur and it seems that the @WebServiceRef isn't the issue, it is just the largest object in the StatelessBeanContext.  JBoss keeps the context in a  thread local pool, because HornetQ uses a cached thread pool of JavaSE, it creates new threads all the time which increases the ammount of contexes unil there is an out of memory exception.


          There is a workaround and this is to set the  UseGlobalPools to false and set  a ThreadPoolMaxSize in the ra.xml file of HornetQ.  That way HornetQ will use a fixed thread pool of JavaSE, it isn't as good as using a thread pool of JBoss but at least the memory leak should be gone.


          Currently I running a basic example to verify, when it fails, I'll greate a JIRA ticket with HornetQ.