scala/scala — pull request #3346 by retronym (2014-01-09 22:23:00+00:00)
Title: Plug a leak in perRunCaches

I guess we've never leaned to heavily on these, because the
registry of caches was forgetting about most of them
immediately if they compared == at the point of creation.

Consequently, maps like `treatedInfos` in Mixin were holding
onto old types and symbols and leaking memory.

You can reproduce the leak with:

(for i in {1..200}; do echo src/library/scala/collection/*.scala; done; printf "\n") | scalac-hash v2.11.0-M7 -J-Xmx256M -Xresident

nsc> warning: there were 6 deprecation warning(s); re-run with -deprecation for details

(... 15 times)

nsc> java.lang.OutOfMemoryError: GC overhead limit exceeded
Dumping heap to java_pid90362.hprof ...
Heap dump file created [340635728 bytes in 7.993 secs]
^CException in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

Review by @gkossakowski