New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutOfMemoryError with logging enabled #82
Comments
From rmis...@google.com on April 19, 2012 04:48:16 I am not sure if we can fix this for when logging is enabled. |
From yan...@google.com on April 25, 2012 15:34:14 I'll take it. We can use FilteredInputStream and FilteredOutputStream. Owner: yan...@google.com |
From yan...@google.com on April 26, 2012 09:31:07 http://codereview.appspot.com/6123059/ Status: Started |
From yan...@google.com on April 27, 2012 09:13:12 Status: Fixed |
From soumi.ak...@gmail.com on May 30, 2012 07:24:03 Hello. I use this api ver. 1.9.0. but the issue seems not resolved. java.lang.OutOfMemoryError this is occurred at... private final HttpResponse execute(HttpRequest request) throws IOException { above code is almost same to sample code. |
From yan...@google.com on April 07, 2012 05:42:31
Version of google-http-java-client (e.g. 1.5.0-beta)? 1.8.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Android Describe the problem. Reported by user here: http://stackoverflow.com/questions/9941378/how-to-download-a-large-file-using-google-api-java-client-on-android copied here:
Recently, I try to use google-api-java-client library to access google document. I can use this library to get a list, create new documents, and update successfully. However, when I want to download a large file (> 10mb) from Google Document, it causes OutOfMemoryError.
03-30 17:57:10.650: E/AndroidRuntime(11022): java.lang.OutOfMemoryError
03-30 17:57:10.650: E/AndroidRuntime(11022): at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91)
03-30 17:57:10.650: E/AndroidRuntime(11022): at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:201)
03-30 17:57:10.650: E/AndroidRuntime(11022): at com.google.api.client.http.AbstractInputStreamContent.copy(AbstractInputStreamContent.java:213)
03-30 17:57:10.650: E/AndroidRuntime(11022): at com.google.api.client.http.AbstractInputStreamContent.copy(AbstractInputStreamContent.java:179)
03-30 17:57:10.650: E/AndroidRuntime(11022): at com.google.api.client.http.HttpResponse.getContent(HttpResponse.java:384)
This is my code:
try {
...
HttpRequest request = getRequestFactory().buildGetRequest(link);
HttpResponse response = request.execute();
InputStream is = response.getContent();
...
} catch (IOException e) {
e.printStackTrace();
}
The response code is 200, and it can work successfully on small files. Is there any method to download a large file using google-api-java-client? How would you expect it to be fixed? No OutOfMemoryError.
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=82
The text was updated successfully, but these errors were encountered: