Issue

Warnings like the one below are observed in the logs:

*WARN* [10.89.13.88 [1486623761832] GET /content/abc/en/search.html HTTP/1.1] org.apache.commons.httpclient.HttpMethodBase Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended

Environment

Custom application code using Apache Commons HttpClient 3.x.

Cause

This occurs with the commons-httpclient 3.x API when the getResponseBody() or getResponseBodyAsString() method is used. The warning means that a response body could potentially be very large (such as a search returning a large response, etc.).  When this occurs, it loads the whole response into memory at once which is inefficient.

Resolution

Modify your application code to instead use getResponseBodyAsStream() and read from the InputStream instead of reading all of it into a large String.

이 작업에는 Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License의 라이센스가 부여되었습니다.  Twitter™ 및 Facebook 게시물은 Creative Commons 약관을 적용받지 않습니다.

법적 고지 사항   |   온라인 개인 정보 보호 정책