I know this comes up every now and again, but I have a leak related to Spring.
I'm using the latest version of Spring, and it appears that
org.springframework.beans.CachedIntrospectionResults is the culprit.
CachedIntrospectionResults does not use WeakReferences for values in the
"classCache" static WeakHashMap when placing Classes that have been loaded
through the same class loader as the CachedIntrospectionResults. I guess it
assumes that the ClassLoader of the CachedIntrospectionResults will be
garbage collected when the container unloads the app? However, in my case
this is not happening, and the leaked CachedIntrospectionResults instances
are eating up memory. JBoss 4.0 doesn't seem to release the Class (though I
haven't figured out why yet... OptimizeIt doesn't want to show me who is
holding the reference to the Class itself). In fact, I've noticed that
generally static references (such as "classCache") are not released when
JBoss 4.0 unloads an application. Not being any kind of expert on class
loading, especially how JBoss does class loading, does anyone know what the
right solution to this issue would be? Is this a JBoss problem? Is it a
Spring problem?
Thanks,
Andy
|