7127687: MethodType leaks memory due to interning

John Rose john.r.rose at oracle.com
Sat Mar 31 00:12:17 UTC 2012

On Mar 28, 2012, at 5:42 PM, Vitaly Davidovich wrote:
> I think you can use diamond generic inference when declaring the weak intern set
Done; thanks.
> Also any reason you didn't use WeakHashMap directly with dummy value to simulate the set? Or wrap the WeakHashMap and synchronize the accessors to it
That's been answered already on this thread.

Building collection-like types from reusable components in Java is not a fully-solved problem, and the symptom is lots of code copying.  Last time I checked, there wasn't even a reusable Map.Entry abstract class.

— John

More information about the core-libs-dev mailing list