-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
HttpUrlFetcher leaks resources #2352
Comments
I've found a few sources of this so far:
|
sjudd
added a commit
to sjudd/glide
that referenced
this issue
Sep 7, 2017
sjudd
added a commit
to sjudd/glide
that referenced
this issue
Sep 7, 2017
That way we will always close the stream in cleanup(). Prior to this change, when cancel was called, stream was never set to non-null and therefore never closed in cleanup. Because disconnecting the stream doesn’t seem to close the contained ResponseBody object, failing to obtain and then close the stream results in leaked objects. Progress towards bumptech#2352
sjudd
changed the title
HttpUrlFetcher leaks resources when following redirects
HttpUrlFetcher leaks resources
Sep 8, 2017
Calling this fixed for now. I might have seen this one time after both changes, so there might still be a race, but it's much less frequent and difficult to reproduce. |
sjudd
added a commit
to sjudd/glide
that referenced
this issue
Sep 8, 2017
Previously some of the logic in run() might null out the data fetcher instance variable, even if it had been set when run() was first called. As a result, the data fetcher would not be cleared. Now the initial data fetcher is held on to as a local variable so the instance variable can be freed without affecting the behavior of cleanup(). Progress towards bumptech#1996, bumptech#2352
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar to #1996, but without the okhttp3 integration library.
Resources are leaked in the flickr sample app just by opening and scrolling:
09-07 07:19:24.684 W/OkHttpClient( 2603): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 07:19:30.298 W/OkHttpClient( 2603): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 07:19:30.299 W/OkHttpClient( 2603): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 07:22:32.056 W/OkHttpClient( 2603): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 07:59:48.489 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 07:59:48.489 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:00:00.305 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:00:00.306 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:00:55.958 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:00:55.958 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:29:08.455 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:29:08.455 W/OkHttpClient( 4621): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:31:43.044 W/OkHttpClient( 4862): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:31:43.046 W/OkHttpClient( 4862): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:32:08.491 W/OkHttpClient( 4862): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
09-07 08:34:11.030 W/OkHttpClient( 4978): A connection to http://farm5.staticflickr.com/ was leaked. Did you forget to close a response body?
The text was updated successfully, but these errors were encountered: