Troubleshooting Nashorn “Method code too large!” exception

前端 未结 2 1659
一整个雨季
一整个雨季 2021-01-14 14:31

Running jjs or ScriptEngine#eval on my JavaScript (https://gist.github.com/also/005fd7c200b20f012e10) crashes with this exception and no more detai

2条回答
  •  清歌不尽
    2021-01-14 14:50

    Nashorn tries to split too large scripts/functions into smaller blocks to compile to bytecode to workaround the per method bytecode size limit imposed by JVM. The Nashorn splitter has improved in jdk 1.8.0 update 40 (being developed, not yet released - but early access available from https://jdk8.java.net/download.html. You may want to try that as well.

提交回复
热议问题