High memory usage or OutOfMemoryException in JON Agent JBoss AS 5 plug-in

Solution Verified - Updated

Environment

  • JBoss Operations Network (JON) 2.4.1, 2.4.2, 3.0
  • JBoss Enterprise Application Platform (EAP) 5, 5.1, 5.1.1, 5.1.2
  • JBoss AS 5 Plug-in
  • Many (50 or more) Managed Component resources such as EJB2, EJB3, WAR, EAR, etc

Issue

  • Experiencing very high memory usage (up to 3Gb) on agents
  • Receive java.lang.OutOfMemoryError: Java heap space when shutting down agent
  • Monitoring or managing EJBs requires a 2 MB to 10 MB memory footprint for each EJB

Resolution

This issue is resolved in JON 3.0.1 and the latest JBoss AS 5 plug-in hot-fix patch for JON 3.0. If you are using a later version of JON, please ensure that the plug-in version is correct for the version of JON you are using.

To workaround the issue, increase the maximum heap size to an amount to accommodate the number of JBoss AS 5 managed component resources that are being managed. This can be determined from a Java core/heap dump or by simply increasing the maximum heap setting for the JON Agent's JVM until the "out of memory" condition no longer occurs.

Root Cause

The JBoss AS 5 plug-in is caching resource properties for managed components (objects derived from ManagedComponentComponent). In some cases, the properties for the managed components can be very large in size. For EJB3 this could be around 9MB for each EJB. The issue is not limited to a specific resource type but will be more evident with resource types for which many resources are based. For example, the issue appears more evident in EJBs because a JBoss AS server could have many EJBs deployed for an application. For more details see This content is not included.Bug 788638.

Diagnostic Steps

SBR

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.