Hi Kohsuke,
Kohsuke Kawaguchi wrote:
>
> While going up from 1.3 to 1.4, I noticed the change in the way classes
> are referenced from caches that XStream builds (for example in
> AnnotationMapper.)
>
> In 1.3, all the classes are weak references, presumably so as not to
> prevent classloaders from getting garbage collected. In 1.4, I noticed
> that this is no longer the case.
>
> So if I'm using XStream in an environment where class loaders come in
> and go, it'd leak classloaders.
>
> This must have been done intentionally. While this doesn't break
> Jenkins, I'm curious as to what prompted this change.
It did simply not work. If you use the class type as key to keep Method,
Field or Constructor instances, you have a reference back to the key and
nothing is garbage collected. The strategy is therefore to tie all caches to
the XStream instance itself.
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email