Skip to content

Have OkHttpRequestHandler evict connectionPool on shutdown#455

Merged
domesticmouse merged 1 commit intogooglemaps:masterfrom
apjanke:tidy-up-okhttp-client
Jul 3, 2018
Merged

Have OkHttpRequestHandler evict connectionPool on shutdown#455
domesticmouse merged 1 commit intogooglemaps:masterfrom
apjanke:tidy-up-okhttp-client

Conversation

@apjanke
Copy link
Copy Markdown
Contributor

@apjanke apjanke commented Jul 3, 2018

This is a minor optimization to support clients that are "doing the wrong thing" and creating many GeoApiContext objects. It somewhat reduces thread and memory pressure in that situation, and makes applications easier to monitor in tools like VisualVM.

Without this patch, in my testing, OkHttpWorker threads accumulate up to about 800 threads before leveling off, with several threads appearing per new GeoApiContext object. With this patch, the growth is slower, and steady state levels off at about 300 threads.

This is not a critical fix; just a nicety for some users.

Follows up discussion in #261.

This is a minor optimization to support clients that are "doing the
wrong thing" and creating many GeoApiContext objects. It somewhat reduces
thread and memory pressure in that situation, and makes applications
easier to monitor in tools like VisualVM.
@domesticmouse domesticmouse merged commit 19bd928 into googlemaps:master Jul 3, 2018
@apjanke apjanke deleted the tidy-up-okhttp-client branch July 5, 2018 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants