High cpu in beanutils WeakHashMap

Solution Verified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP)
  • Apache Commons Beanutils

Issue

  • We see high CPU usage in several threads accessing a WeakHashMap in org.apache.commons.beanutils.MethodUtils.getMatchingAccessibleMethod:
"http-mrkcrsbtvlpr01%2F172.25.70.81-8200-206" daemon prio=10 tid=0x00007fbac8275800 nid=0x4865 runnable [0x00007fba97159000]
   java.lang.Thread.State: RUNNABLE
	at java.util.WeakHashMap.get(WeakHashMap.java:470)
	at org.apache.commons.beanutils.MethodUtils.getMatchingAccessibleMethod(MethodUtils.java:530)
	at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:209)
	at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:217)
	at org.apache.commons.digester.Rule.end(Rule.java:253)

Resolution

  • Upgrade your commons beanutils library to 1.8.0 or later

Root Cause

Components
Category

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.