From paultaylor at jthink.net Thu Sep 26 12:51:14 2024 From: paultaylor at jthink.net (Paul Taylor) Date: Thu, 26 Sep 2024 13:51:14 +0100 Subject: Seems to be some sort of binding limit around 500 mark for Nashorn Message-ID: <7872a945-e1ab-4914-b905-85c6049741aa@jthink.net> HI, my code loads a Nashorn Script Engine binding values representing metadata fields and allows user to write Javascript to modify those metadata fields by passing the script to the eval method and then checking for modified metadata values. It was working fine but as I have increased the number of values added to the bindings I have unexpected issues that some binding variables values are missing or changed despite the script not modifying these values. I am now able to mimic the problem with self contained example |import javax.script.ScriptContext; import javax.script.ScriptEngine; public class JsTest { public static void main(String[] args) throws Exception { int numberOfBindingVars = Integer.parseInt(args[0]); ScriptEngine engine; for(int i=0; i<10; i++) { engine = new org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory().getScriptEngine(); for(int k=0;k