2010/5/3 Mark Shifman <mark.shif...@yale.edu>:
> Using jmap -histo pid, I can watch 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl, etc increase in number
> (...)
>
> The JAXBContext instance is created with a singleton that is an enum (using 
> Josh Block's pattern):
>

The cause might be somewhere else.

JAXBContextMascot.INSTANCE is a singleton, which means (roughly
speaking) that it is present in the memory while its containing Class
is alive,  and the Class is alive while  the ClassLoader is alive.

I wonder how enums are implemented.
WebappClassLoader#clearReferencesStaticFinal() clears static fields of
classes,  but it skips fields which name contains '$'.

E.g. internal $VALUES field in the enum class that holds array of all
values will be skipped.


Thus, it looks like an indication of the leak, but not the leak itself.

(From your later emails it looks that you figured that already).



There are known cases when a leak was not detectable with profilers.
E.g. JavaDoc in JreMemoryLeakPreventionListener.java source code for
the xmlParsingProtection field mentions one.

IIRC, there was some sun bugreport for that, but I do not have a reference.

I hope that that is not your case.



Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to