Implementing Lambda with Capture support makes Metaspace fills LambdaForms$BMH class
Wenlei Xie
wenlei.xie at gmail.com
Tue May 2 19:29:38 UTC 2017
Hi,
We are implementing Lambda function with capture support in a SQL Engine.
We currently implement by compiling user-written Lambda Expression into a
MethodHandle. And use bindTo to captured fields. Thus for each row we will
have a Bound Method Handle.
However, we found JVM will generate the byte code Bound Method Handle once
it's invoked more than 128 times. This cause in some cases (when the table
has large arrays), the Metaspace fills with generated LambdaForm$BMH class.
Here is the simple code to reproduce the issue:
https://github.com/wenleix/BMHTest . It looks we cannot increase
java.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD beyond 128. Any
suggestions to implement Lambda with Capture Support on JVM?
Thank you !!
Best,
Wenlei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20170502/17102be1/attachment.html>
More information about the mlvm-dev
mailing list