title: Apache CXF not releasing clients
body: <p>I've discovered my application is heavily leaking memory.  After taking heap dumps it appears Apache CXF (2.7.7) seems to be referencing lots of JaxWsServiceConfiguration (14000 in a day).</p>
  
  <p>I'm not sure if I am using it correctly, whether I need to somehow release the client or there is a bug in CXF.  Hopefully somebody can point me in the right direction here.</p>
  
  <p>I am using a <code>JaxWsProxyFactoryBean</code> injected into my service methods.  The following line is called to create the client proxy (called for <strong>every</strong> request to the web service):</p>
  
  <pre><code>jaxWsProxyFactoryBean.create();
  </code></pre>
  
  <p>Eventually the service method finishes but it looks like the factory holds reference to the client proxy and therefore never GCs it.</p>
  
  <p>I thought I could create a single static client and always use this but am a little nervous of this since it is not thread-safe in all circumstances: <a href="http://cxf.apache.org/faq.html#FAQ-AreJAX-WSclientproxiesthreadsafe" rel="nofollow">http://cxf.apache.org/faq.html#FAQ-AreJAX-WSclientproxiesthreadsafe</a>?</p>
  
  <p>Should I be doing this differently?</p>