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

Enable reuseKeys on WeakConcurrentMap #1226

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

jpbempel
Copy link
Member

for each call to get method in WeakConcurrentMap, a LatentKey is
created. Considering the frequency of call it's significant.
Also, the classloader of the tracer can be considered as permanent
through the lifecycle of the JVM which is a prerequisite to be able
to reuse keys (otherwise classloader leak).

for each call to get method in WeakConcurrentMap, a LatentKey is
created. Considering the frequency of call it's significant.
Also, the classloader of the tracer can be considered as permanent
through the lifecycle of the JVM which is a prerequisite to be able
to reuse keys (otherwise classloader leak).
@jpbempel jpbempel requested a review from a team as a code owner February 17, 2020 08:19
Copy link
Contributor

@devinsba devinsba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. What would be the drawback?

@jpbempel
Copy link
Member Author

Makes sense to me. What would be the drawback?

reuse mode use a ThreadLocal cache for the LatentKey. The doc warn about a potential ClassLoader leak if you are using the map in a context of reloading a container.

@jpbempel jpbempel merged commit efe8ee3 into DataDog:master Feb 18, 2020
@jpbempel jpbempel deleted the jpbempel/reuseKeys branch February 18, 2020 18:09
@randomanderson randomanderson added this to the 0.44.0 milestone Feb 26, 2020
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.

None yet

4 participants