I am using Jersey Client (v2.17) to make external calls from my app.
I found out this memory leak bug (the CPU consumption was very high) which made me re-write my code to make the client static like this:
public class GeneralUtil {
private static final Client client = ClientBuilder.newClient()
public static String makeCall(String url) throws NotFoundException {
return client.target(url).request().get(String.class);
}
}
However, now I have concurrency problems - I am using this class to be called from multiple threads. I keep on getting:
org.apache.http.impl.execchain.RequestAbortedException: Request aborted
Any suggestion - how can I still prevent the memory leak, and still use the client?