Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMemory leak in symbol attachments #7018
Comments
This comment has been minimized.
This comment has been minimized.
Imported From: https://issues.scala-lang.org/browse/SI-7018?orig=1 |
This comment has been minimized.
This comment has been minimized.
@retronym said: |
scabug
closed this
Jan 27, 2013
scabug
added
blocker
has PR
labels
Apr 7, 2017
scabug
added this to the 2.10.1 milestone
Apr 7, 2017
scabug
assigned
retronym
Apr 7, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
scabug commentedJan 24, 2013
Symbol attachments leak through the $outer pointer. Proof is in this gist:
https://gist.github.com/4622507
You need to have an input file for that to work, place the one in the gist it under ./src (the directory from where you'll run the test).
The attachments leak instances of
NonemptyAttachments
through the outer pointer (in this case, there's a chain of 101 instances).The problem is that NonemptyAttachments extends its own outer class (yeah, it takes a while to grok this), so every time you create a new instance, you capture the outer instance.. which happens to be another instance of NonemptyAttachments. That's a very interesting way to create linked lists, but in this case I'm pretty sure it's unintended.