Some OpenNMS users are seeing unexpectedly large amounts of memory usage that is causing high CPU utilization due to garbage collection. When investigating this issue by analyzing heapdumps from the systems, I discovered that there is a large amount of RAM being retained by the list of CollectableService objects. After drilling down into these objects, it appears that a lot of the RAM is being used by an instance of the scripting engine that is used to evaluate threshold expressions.
In 1.8, we used the JEP library for this purpose and in the 1.10 branch, the engine was changed to JEXL. In both cases, the ExpressionConfigWrapper class retains a reference to the script engine. I'm going to change the code so that instead of holding this reference as a class field, we just call the constructor as needed to create a new script engine.