Issue Details (XML | Word | Printable)

Key: MULE-3521
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Dirk Olmes
Reporter: Calvin Xiu
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Mule

AbstractEntryPointResolver has serious memory leak

Created: 03/Jul/08 10:49 PM   Updated: 07/Jul/08 12:44 PM
Component/s: Core: (other)
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Time Tracking:
Not Specified

Labels:
User impact: High


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Dirk Olmes added a comment - 07/Jul/08 08:42 AM
Good catch, Calvin.

This bug affects only a few EntryPointResolvers, namely:

  • ExplicitMethodEntryPointResolver
  • MethodHeaderPropertyEntryPointResolver

Anyway the ExplicitMethodEntryPointResolver was broken ever since it was introduced and fixing the AbstractEntryPointResolver unearthed that.

http://fisheye.codehaus.org/changelog/mule/?cs=12242