Don't suppose it's possible that a bug has been inadvertently introduced by the fix provided in
GROOVY-5187 (which GC's script classes)?
Have a scenario where an eval is done, creating some classes (basically akin to including code from a separate script). A second eval is done which depends on classes created in the first (same execution engine, obviously). A bunch of work is done in this second eval, using lots of memory, undoubtedly invoking GC. At a later point a method that was supposedly created by the first eval is called and is not found:
MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getTRTimedParm()
Note that it isn't even trying to associate it with a script class as it should, but with the engine itself.
We were previously at version 2.0.1 which did not seem to have this problem, but I can't say for certain without going back to that version and trying this particular test case.
We are working around the problem by re-evaling the first script right before the use of the 'missing' method, which is obviously not ideal.
Is there a way to tell the engine to GC on demand?