AbstractEntryPointResolver use StringBuffer as key of a Map
but StringBuffer didn't override the equals() method from Object.
So the methodCache Map is always growing, it lead a serious memory leak.
source code:
protected Method addMethodByName(Method method, MuleEventContext context)
{
StringBuffer key = ....;
Method previousMethod = (Method) methodCache.putIfAbsent(key, method);
return (previousMethod != null ? previousMethod : method);
}
so, the getMethodByName() should change
methodCache.get(key);
to
methodCache.get(key.toString());
addMethodByName() should change
Method previousMethod = (Method) methodCache.putIfAbsent(key, method);
to
Method previousMethod = (Method) methodCache.putIfAbsent(key.toString(), method);
BTW. have the team do a load test about Mule 2.0. ? the AbstractEntryPointResolver is a mainly class ,when run any load test, the memory leak will always happen.
This bug affects only a few EntryPointResolvers, namely:
Anyway the ExplicitMethodEntryPointResolver was broken ever since it was introduced and fixing the AbstractEntryPointResolver unearthed that.
http://fisheye.codehaus.org/changelog/mule/?cs=12242