On 03/05/2010 17:15, Mark Shifman wrote:
> I have a web app running under tomcat-6.0.26 with JreMemoryLeakPreventi=
onListener, java jdk1.6.0_18.
>=20
> Using jmap -histo pid, I can watch com.sun.xml.internal.bind.v2.runtime=
=2EJAXBContextImpl, etc increase in number
> after running my unmarshal action, followed by undeploy and redeploy. =
Find Leaks in the manager also finds leaks.
After a few undeploy/redeploy cycles does the number of
WebappClassLoader's also increase?
> The JAXBContext instance is created with a singleton that is an enum (u=
sing Josh Block's pattern):
>=20
> public enum JAXBContextMascot {
> INSTANCE("com.matrixscience.xmlns.schema.mascot_search_results_2" );
> private JAXBContext ctx;
> JAXBContextMascot(String contextPath) {
> try {
> ctx =3DJAXBContext.newInstance(clazz);
Where does the 'clazz' variable come from?
> } catch (JAXBException e) {
> throw new RuntimeException(e);
> }
> }
> public Unmarshaller createUnmarshaller(){
> try {
> return ctx.createUnmarshaller();
> } catch (JAXBException e) {
> throw new RuntimeException(e);
> }
> }
> }
>=20
> Am I doing something wrong which is causing the memory leak?
Maybe.
> JAXBContext.newInstance() can take a ClassLoader argument. Is there so=
me ClassLoader I should be using that will get around this?
Where is the jar with the above code, in a webapp?
p
> Any help would be appreciated.
> mas
>=20
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>=20
|