Last active
January 3, 2016 07:39
-
-
Save shenie/8431303 to your computer and use it in GitHub Desktop.
Memory leak in groovy with toString() on instances of mixed in class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BarMixin { | |
} | |
Date.mixin(BarMixin) | |
100.times { | |
println "#${it + 1}" | |
def bar = new Date() | |
bar.toString() | |
sleep 100 | |
} | |
println "check heap and see all those instances of Date even after you forced a GC" | |
sleep 20000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment