Field reference to script engine appears to cause memory bloat
Description
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.
Acceptance / Success Criteria
None
Attachments
1
Lucidchart Diagrams
Activity
Show:
Seth Leger November 30, 2011 at 1:31 PM
I've changed ExpressionConfigWrapper so that it no longer retains a field reference to the script engine. This should eliminate a lot of memory usage on systems with a large amount of data collection. Marking as fixed.
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.