Search code examples
jax-rswebsphere

IBM JAX-RS 2.0 client and baseClients


We are using Websphere with her JAX-RS implementation. Our app reuse Client object (does not close it after every call). But in IBM JAXRSClientImpl is some baseClients hashMap (cxf use WeakHashMap) with is still growing. I didnt find other solution how to fix this except close the Client object. Any sugestions?


Solution

  • The previously posted assumption is correct that the use of a HashMap for client references was causing these refs to hang around until the client was closed, causing a potential memory leak. The code in com.ibm.ws.jaxrs20.client.JAXRSClientImpl has been fixed to utilize a WeakHashMap, which should address this issue. The change has been delivered under APAR PH28458 (https://www.ibm.com/support/pages/apar/PH28458). The fix for this APAR is targeted for inclusion in fix pack 9.0.5.6.. So if you upgrade to version 9.0.5.6 or newer the issue should be resolved.