Peter,

Thanks for looking into that and for you initial prototype!

So WeakReferences did not hold LambdaForms long enough even with strong
back-reference from LambdaForm to the lambda form 'this' was derived
from? So final derived LambdaForms (leaves) are not kept referenced from
the code? Or did back-references keep intermediate LambdaForms in cache
for too long (forever?) and you wanted them to be evicted too?
Regarding back references, my main concern was footprint. In some corner cases, LambdaFormEditor chain can become very long and I wanted to allow unloading of unused LambdaForms.

Also, there's another major source of method handles - MethodTypeForm - where most of the LambdaFormEditor chains root. It should be cleared as well to avoid memory exhaustion.

Regarding WeakReferences, my experiments showed that cache hit rate degrades significantly when they are used (30x more instantiated LambdaForms- from 1-3k to 30k-60k on Octane/Nashorn).

So, SoftReferences look like a good fit.

Best regards,
Vladimir Ivanov
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to