OutOfMemoryError « Thread « JSP-Servlet Q&A





3. java.lang.OutOfMemoryError: unable to create new native thread    java-forums.org

public InputStream getStudentInfo(String studentId) throws Exception { URL url = new URL(WS_SERVER_URL + WS_SERVICE_PATH + WS_PARAM + URLEncoder.encode(studentId, "UTF-8")); HttpURLConnection connection = (HttpURLConnection)url.openConnection(); connection.setConnectTimeout(5000); connection.setRequestMethod("GET"); connection.setInstanceFollowRedirects(false); connection.setUseCaches(false); connection.setDoOutput(true); connection.setDoInput(true); connection.connect(); int responseCode = connection.getResponseCode(); InputStream result; if (responseCode == 200) { result = connection.getInputStream(); } else { throw new Exception("The error occurs while downloading data. (" + connection.getResponseCode() + " " ...