[9, 8u40] RFR (M): 8057020: LambdaForm caches should support eviction

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Dec 3 11:11:59 UTC 2014


On 12/01/2014 07:58 PM, Vladimir Ivanov wrote:
> http://cr.openjdk.java.net/~vlivanov/8057020/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8057020

Looks okay, although the cache management logic gives me a headache
after the vacation. I thought I spotted a few bugs, but those were only
false positives.

> The fix is to use SoftReferences to keep LambdaForms alive as long as
> possible, but avoid throwing OOME until the caches are evicted. I
> experimented with WeakReferences, but it doesn't hold LambdaForms for
> long enough: LambdaForm cache hit rate degrades significantly and it
> negatively affects application startup and warmup, since every
> instantiated LambdaForm is precompiled to bytecode before usage.
> 
> Testing: jdk/java/lang/invoke/LFCache in stress mode + jck
> (api/java_lang/invoke), jdk/java/lang/invoke, jdk/java/util/streams, octane

SoftReferences are tricky in the way they can get suddenly drop the
referent, and normal testing would not catch it (e.g. the normal
operation would reclaim softrefs under your feet almost never). Does
this code survive with -XX:SoftRefLRUPolicyMSPerMB=0?

Thanks,
-Aleksey.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20141203/050e83a8/signature.asc>


More information about the mlvm-dev mailing list