title: org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
body: <p>I use Multi-thread to scan the different URL in the same time in java. There was the bug,if the sum of request time exceed 100,000. I have already close which i should close.  Here the code from my servlet </p>
  
  <pre><code>private String proyGetHttp(String url) throws ParseException, IOException,
              InterruptedException {
  
          String content = "";
          getMethod = new HttpGet(url);
          HttpResponse response = null;
          HttpEntity httpEntity = null;
          boolean success = false;
          while (!success) {
              System.out.println("url：" + url + "，connect...");
              try {
                  response = client.execute(getMethod);
                  httpEntity = response.getEntity();
                  StringBuffer sb = new StringBuffer();
                  if (httpEntity != null) {
                      BufferedReader in = null;
                      InputStream instream = httpEntity.getContent();
                      try {
                          in = new BufferedReader(new InputStreamReader(instream));
                          String lineContent = "";
                          while(lineContent != null){
                              sb.append(lineContent);
                              lineContent = in.readLine();
                          }
  
                      } catch (Exception ex)
                          getMethod.abort();
                          throw ex;
                      } finally {
                          // Closing the input stream will trigger connection release
                          try { instream.close(); in.close();} catch (Exception ignore) {}
                      }
                  }
                  content = sb.toString();
                  success = true;
                  System.out.println("connect successfully...");
              } catch (Exception e) {
                  e.printStackTrace();
                  getMethod.abort();
                  System.out.println("connect fail, please waitting...");
                  Thread.sleep(sleepTime);
              }finally{
                  getMethod.releaseConnection();
              }
          }
          return content;
      }
  </code></pre>
  
  <p>Here code create the default client <br/></p>
  
  <pre><code>        PoolingClientConnectionManager cm = new PoolingClientConnectionManager();
          cm.setMaxTotal(100);
          DefaultHttpClient client = null;
          client = new DefaultHttpClient(cm);
          client.getParams().setParameter("http.protocol.cookie-policy", CookiePolicy.BROWSER_COMPATIBILITY);
          client.getParams().setParameter(HttpConnectionParams.CONNECTION_TIMEOUT, 5000);
  </code></pre>