Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Reduce permgen use from Groovy scripts #7658
This is because the GroovyClassLoader hangs on to every class ever created in its class cache. In benchmarks, I can only load ~500 scripts into a Java7 vm with default permgen settings before OOM/permgen. I can get a few thousand in with Java8.
The following patch works for me for dynamic scripts, and I believe it shouldn't have a downside, because (1) ES has it's own Guava class cache (that actually releases classes), and (2) I can't find a codepath in ES that even indirectly uses the GroovyClassLoader's class cache.