4
저지 v10을 사용 중이고 다음 코드를 작성했습니다. 메모리 누출을 피하기 위해 저지 클라이언트 연결을 닫는 올바른 방법입니다. 이전에 int를 호출하지 않았습니다.저지 클라이언트 연결 닫기 메모리 누출 문제
ClientConfig config = setupHttps();
final Client c = Client.create(config);
final WebResource r = c.resource(baseUri);
ClientResponse response = null;
try {
response = r.path("/....")
.header("contentId", id)
.header("sid", sid).get(ClientResponse.class);
...
} catch (Exception e) {
log.error("Error returning contentServiceName.");
} finally {
if (response != null) {
response.close();
}
if (c!= null) {
c.destroy();
}
}
TIA, 비제이