Skip to content

Fix memory leak in runtime reflections TypeTag caches #8470

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

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

retronym
Copy link
Member

@retronym retronym commented Oct 15, 2019

Keep a weak reference to the TypeTag value stored in the ClassValue as it refers
to the key.

Fixes scala/bug#11767

Keep a weak reference to the TypeTag value stored in the ClassValue as it refers
to the key.
@zsxwing
Copy link
Contributor

zsxwing commented Oct 16, 2019

Looks good to me. Thanks for fixing this quickly!

Copy link
Contributor

@hrhino hrhino left a comment

Choose a reason for hiding this comment

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

Subtle!

@@ -0,0 +1,30 @@
import scala.reflect.runtime.universe
Copy link
Contributor

Choose a reason for hiding this comment

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

To follow the convention, perhaps we could call this t11767.scala.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would have helped me. A new PR fails this test, and I was like, where is that test, when was it deleted? Finally realized it was on 2.12 and also recent. However, TIL --full-history.

@retronym retronym merged commit 9b5b9b5 into scala:2.12.x Oct 21, 2019
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants