7127687: MethodType leaks memory due to interning

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

On Mar 28, 2012, at 7:50 PM, David Holmes wrote:

> One query I have is whether, given its intended usage, this change might add pressure to the reference processing subsystem?

Not undue pressure, I hope.  JSR 292 applications tend to converge rapidly on the number of distinct MethodTypes they use.  After this the MethodType intern table will be stable and its entries will not need reference queue processing.

The main exception to this generalization (which the current patch addresses) is that some applications load wads of code via class loaders and then throw the class loaders away.  This will cause various kinds of churn in the JVM internals, leading to whole classes (etc.) being garbage collected.  In that case, the MethodType table needs to "keep up" with the rest of the churn, and not cause a storage leak.  I don't see how it can add a significant new overhead.  The reclamation of the classes themselves is a far bigger job.

— John

More information about the core-libs-dev mailing list