Skip to content
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

High contention in com/google/api/client/util/ClassInfo.of #642

Closed
edalquist opened this issue May 17, 2019 · 0 comments · Fixed by #643
Closed

High contention in com/google/api/client/util/ClassInfo.of #642

edalquist opened this issue May 17, 2019 · 0 comments · Fixed by #643
Assignees

Comments

@edalquist
Copy link
Contributor

com/google/api/client/util/ClassInfo.of uses a WeakHashMap in a synchronized block to cache references to ClassInfo. This method is called every time any subclass of GenericData is created. The resulting synchronization on the WeakHashMap is a source of significant contention in highly concurrent applications.

Further the use of WeakHashMap here doesn't actually do any memory cleanup.

  • The key is the Class
  • The Class is referenced as a field in ClassInfo
  • ClassInfo is stored as a strong reference in the value side of the WeakHashMap

As a result the weak keys will never be unreferenced and removed.

clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
🤖 I have created a release \*beep\* \*boop\*
---
## [0.26.0](https://www.github.com/googleapis/google-auth-library-java/compare/v0.25.5...v0.26.0) (2021-05-20)


### Features

* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([googleapis#674](https://www.github.com/googleapis/google-auth-library-java/issues/674)) ([359b20f](https://www.github.com/googleapis/google-auth-library-java/commit/359b20f24f88e09b6b104c61ca63a1b604ea64d2))
* added getter for credentials object in HttpCredentialsAdapter ([googleapis#658](https://www.github.com/googleapis/google-auth-library-java/issues/658)) ([5a946ea](https://www.github.com/googleapis/google-auth-library-java/commit/5a946ea5e0d974611f2205f468236db4b931e486))
* enable pre-emptive async oauth token refreshes ([#646](https://www.github.com/googleapis/google-auth-library-java/issues/646)) ([e3f4c7e](https://www.github.com/googleapis/google-auth-library-java/commit/e3f4c7eac0417705553ef8259599ec29fc8ad9b4))
* Returning an issuer claim on request errors ([googleapis#656](https://www.github.com/googleapis/google-auth-library-java/issues/656)) ([95d70ae](https://www.github.com/googleapis/google-auth-library-java/commit/95d70ae0f5f4c985455f913ddef14ebe75500656))


### Bug Fixes

* use orginal url as audience for self signed jwt if scheme or host is null ([googleapis#642](https://www.github.com/googleapis/google-auth-library-java/issues/642)) ([b4e6f1a](https://www.github.com/googleapis/google-auth-library-java/commit/b4e6f1a0bd17dd31edc85ed4879cea75857fd747))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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 a pull request may close this issue.

2 participants