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.

1.8 commit
eeaf5dff78f405b078da29bfcbf0ea89b2db1760

1.10 commit
e32fa7a5176eee64e20a4a07db471cb43e09a760

Seth Leger November 30, 2011 at 1:27 PM

Screenshot of heapdump analyzer showing 59,232 bytes used by org.nfunk.jep.JEP. Heapdump taken from a system running version 1.8.16.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

PagerDuty

Created November 30, 2011 at 1:05 PM
Updated January 27, 2017 at 4:20 PM
Resolved November 30, 2011 at 1:31 PM