You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Joe Germuska <Jo...@Germuska.com> on 2004/09/15 19:07:02 UTC

Memory Leak in MappingDispatchAction?

Wanted to run this by some folks:

Our largest Struts application has become a total memory hog.  This 
has led our system administrator to take a crash source in the 
under-development JBoss profiler.  We're not expert in reading the 
output of that, but it seems to point back to a lot of memory being 
used by the HashMap of dispatch methods kept by 
MappingDispatchAction.  If I've got my we have over 200 action 
mappings in this app, and I suspect that every one of them uses 
MappingDispatchAction.

Assuming for now that we are actually reading the profiler correctly, 
is there any reason why that map shouldn't just be made a 
WeakHashMap?  When it comes down to reflection, I don't really have a 
good idea of when Method objects would be created or going out of 
scope, but considering how casual Struts is about using reflection in 
general, how bad could it be to have an extra reflection call for 
those times when a Method gets garbage collected out of the 
WeakHashMap?

If anyone out there has more experience using the JBoss profiler, you 
might be able to coach us to better analysis.

Thanks in advance,
	Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn 
back; I'll know I'm in the wrong place."
    - Carlos Santana