You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by James Annesley <ja...@infoshare-is.com> on 2012/02/01 17:25:29 UTC

Memory leak in Tomcat

Hi,

 

I have an XML beans based AXIS 2 1.6.0 stub. After using the client's UI for
a short period of time - say a few minutes - having un-deployed the web app
I get about 50 or so messages as follows:

 

01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks

SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
[org.apache.xmlbeans.XmlBeans$1] (value
[org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
[java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
but failed to remove it when the web application was stopped. Threads are
going to be renewed over time to try and avoid a probable memory leak.

 

Can anyone shed any light on this?

 

Best

 

James


Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom

Phone: 		+ 44 (0) 20 8541 0111
Support:	+ 44 (0) 20 8481 4760
Web:		www.infoshare-is.com
E-mail:		info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. 
Any views or opinions do not represent the views or opinions 
of Infoshare Ltd.
If you have received this e-mail in error please notify the sender 
and delete it. You may not use, copy or disclose the information 
in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print 
this email?

RE: Memory leak in Tomcat

Posted by James Annesley <ja...@infoshare-is.com>.
Hi,

I am now starting Tomcat with the parameters suggested below and it copes
with a redeployment.
Tomcat heap:
Size: 151,126,016 B

Used: 104,701,448 B

Max: 2,118,123,520 B

Tomcat perm gen:
Size: 85,262,336 B

Used: 85,148,344 B

Max: 85,983,232 B

It adds about 20MB to perm gen every redeployment. Please see my other
reply.

I'll try your suggestions,

Thanks.

-----Original Message-----
From: Pid [mailto:pid@pidster.com] 
Sent: 02 February 2012 11:00
To: java-user@axis.apache.org
Subject: Re: Memory leak in Tomcat

On 01/02/2012 17:10, Moises Alberto Lindo Gutarra wrote:
> For this type of error you must tuning your apache tomcat for example like
this:
>  -server -Xms2048m -Xmx2048m -XX:PermSize=128m -XX:MaxPermSize=256m in 
> Environment Variable JAVA_OPTS into catalina.sh or catalina.bat

Eh?  Why will increasing the memory fix a ThreadLocal cleanup problem?


> 2012/2/1 James Annesley <ja...@infoshare-is.com>:
>> Tomcat 7.0.25 x64
>> RAM= 8GB
>> CPU = 8xCPU
>> Java = jdk1.6.0_25 x64
>>
>> I am looking at the tomcat instance in visualvm. I have got eclipse 
>> open which takes 1 GB. PermGen is close to max. It ran out of PermGen 
>> when I redeployed.

You mention Eclipse, but you don't say how much memory Tomcat is consuming,
or is configured to use.  Increasing PermGen will just delay the leak.

If the application is in development, increasing PermGen may allow you to
reload the application without an OOM, while Tomcat cleans up the thread
locals & renews the threads after a short delay.  I'd recommend configuring
a small number (5) of threads during development.


Do you have the ThreadLocalLeakPreventionListener configured in your
server.xml file?

 
http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#ThreadLocal_Le
ak_Prevention_Listener_-_org.apache.catalina.core.ThreadLocalLeakPreventionL
istener

See also 'renewThreadsWhenStoppingContext':

 http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

If you need assistance with this, ask at the Tomcat Users mailing list.


p

>> Is this enough info?
>>
>> James
>>
>>
>> -----Original Message-----
>> From: Moises Alberto Lindo Gutarra [mailto:mlindo@gmail.com]
>> Sent: 01 February 2012 16:31
>> To: java-user@axis.apache.org
>> Subject: Re: Memory leak in Tomcat
>>
>> can you tell us your tomcat memory configuration and harware ram, 
>> cpu, type
>> (32 or 64 bits) characteristics???
>>
>> 2012/2/1 James Annesley <ja...@infoshare-is.com>
>>>
>>> Hi,
>>>
>>>
>>>
>>> I have an XML beans based AXIS 2 1.6.0 stub. After using the 
>>> client’s UI
>> for a short period of time – say a few minutes – having un-deployed 
>> the web app I get about 50 or so messages as follows:
>>>
>>>
>>>
>>> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
>>> checkThreadLocalMapForLeaks
>>>
>>> SEVERE: The web application [/xxxx] created a ThreadLocal with key 
>>> of type
>> [org.apache.xmlbeans.XmlBeans$1] (value 
>> [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type 
>> [java.lang.ref.SoftReference] (value 
>> [java.lang.ref.SoftReference@1a4d1557])
>> but failed to remove it when the web application was stopped. Threads 
>> are going to be renewed over time to try and avoid a probable memory
leak.
>>>
>>>
>>>
>>> Can anyone shed any light on this?
>>>
>>>
>>>
>>> Best
>>>
>>>
>>>
>>> James
>>>
>>> Infoshare Ltd
>>> Millennium House
>>> 21 Eden Street
>>> Kingston upon Thames
>>> Surrey
>>> KT1 1BL
>>> United Kingdom
>>>
>>> Phone: +44 (0) 20 8541 0111
>>> Support:  +44 (0) 20 8481 4760
>>> Web:  http://www.infoshare-is.com/
>>> E-mail:  info@infoshare-is.com
>>>
>>> Infoshare Ltd is registered in England and Wales.
>>> Registered Office as above.
>>> Registered Number 2877612
>>> VAT Number GB 678 1443 10
>>>
>>> The content of this e-mail (and any attachment to it) is 
>>> confidential. Any
>> views or opinions do not represent the views or opinions of Infoshare
Ltd.
>> If you have received this e-mail in error please notify the sender 
>> and delete it. You may not use, copy or disclose the information in any
way.
>>>
>>> Infoshare Ltd monitors incoming and outgoing e-mails.
>>>
>>> Please consider the environment. Do you really need to print this email?
>>
>>
>>
>>
>> --
>> Atte.
>> Moisés Alberto Lindo Gutarra
>> Asesor - Desarrollador Java / Open Source Linux Registered User 
>> #431131 - http://counter.li.org/
>> Cel: (511) 995081720 - Rpm: *548913
>> EMail: mlindo@gmail.com
>> MSN: mlindo@tumisolutions.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>>
>> Infoshare Ltd
>> Millennium House
>> 21 Eden Street
>> Kingston upon Thames
>> Surrey
>> KT1 1BL
>> United Kingdom
>>
>> Phone:          + 44 (0) 20 8541 0111
>> Support:        + 44 (0) 20 8481 4760
>> Web:            www.infoshare-is.com
>> E-mail:         info@infoshare-is.com
>>
>> Infoshare Ltd is registered in England and Wales.
>> Registered Office as above.
>> Registered Number 2877612
>> VAT Number GB 678 1443 10
>>
>> The content of this e-mail (and any attachment to it) is confidential.
Any views or opinions do not represent the views or opinions of Infoshare
Ltd.
>> If you have received this e-mail in error please notify the sender and
delete it. You may not use, copy or disclose the information in any way.
>>
>> Infoshare Ltd monitors incoming and outgoing e-mails.
>>
>> Please consider the environment. Do you really need to print this email?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
> 
> 
> 


-- 

[key:62590808]


Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom

Phone: 		+ 44 (0) 20 8541 0111
Support:	+ 44 (0) 20 8481 4760
Web:		www.infoshare-is.com
E-mail:		info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd.
If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Memory leak in Tomcat

Posted by Pid <pi...@pidster.com>.
On 01/02/2012 17:10, Moises Alberto Lindo Gutarra wrote:
> For this type of error you must tuning your apache tomcat for example like this:
>  -server -Xms2048m -Xmx2048m -XX:PermSize=128m -XX:MaxPermSize=256m
> in Environment Variable JAVA_OPTS into catalina.sh or catalina.bat

Eh?  Why will increasing the memory fix a ThreadLocal cleanup problem?


> 2012/2/1 James Annesley <ja...@infoshare-is.com>:
>> Tomcat 7.0.25 x64
>> RAM= 8GB
>> CPU = 8xCPU
>> Java = jdk1.6.0_25 x64
>>
>> I am looking at the tomcat instance in visualvm. I have got eclipse open
>> which takes 1 GB. PermGen is close to max. It ran out of PermGen when I
>> redeployed.

You mention Eclipse, but you don't say how much memory Tomcat is
consuming, or is configured to use.  Increasing PermGen will just delay
the leak.

If the application is in development, increasing PermGen may allow you
to reload the application without an OOM, while Tomcat cleans up the
thread locals & renews the threads after a short delay.  I'd recommend
configuring a small number (5) of threads during development.


Do you have the ThreadLocalLeakPreventionListener configured in your
server.xml file?

 http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#ThreadLocal_Leak_Prevention_Listener_-_org.apache.catalina.core.ThreadLocalLeakPreventionListener

See also 'renewThreadsWhenStoppingContext':

 http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

If you need assistance with this, ask at the Tomcat Users mailing list.


p

>> Is this enough info?
>>
>> James
>>
>>
>> -----Original Message-----
>> From: Moises Alberto Lindo Gutarra [mailto:mlindo@gmail.com]
>> Sent: 01 February 2012 16:31
>> To: java-user@axis.apache.org
>> Subject: Re: Memory leak in Tomcat
>>
>> can you tell us your tomcat memory configuration and harware ram, cpu, type
>> (32 or 64 bits) characteristics???
>>
>> 2012/2/1 James Annesley <ja...@infoshare-is.com>
>>>
>>> Hi,
>>>
>>>
>>>
>>> I have an XML beans based AXIS 2 1.6.0 stub. After using the client’s UI
>> for a short period of time – say a few minutes – having un-deployed the web
>> app I get about 50 or so messages as follows:
>>>
>>>
>>>
>>> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
>>> checkThreadLocalMapForLeaks
>>>
>>> SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
>> [org.apache.xmlbeans.XmlBeans$1] (value
>> [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
>> [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
>> but failed to remove it when the web application was stopped. Threads are
>> going to be renewed over time to try and avoid a probable memory leak.
>>>
>>>
>>>
>>> Can anyone shed any light on this?
>>>
>>>
>>>
>>> Best
>>>
>>>
>>>
>>> James
>>>
>>> Infoshare Ltd
>>> Millennium House
>>> 21 Eden Street
>>> Kingston upon Thames
>>> Surrey
>>> KT1 1BL
>>> United Kingdom
>>>
>>> Phone: +44 (0) 20 8541 0111
>>> Support:  +44 (0) 20 8481 4760
>>> Web:  http://www.infoshare-is.com/
>>> E-mail:  info@infoshare-is.com
>>>
>>> Infoshare Ltd is registered in England and Wales.
>>> Registered Office as above.
>>> Registered Number 2877612
>>> VAT Number GB 678 1443 10
>>>
>>> The content of this e-mail (and any attachment to it) is confidential. Any
>> views or opinions do not represent the views or opinions of Infoshare Ltd.
>> If you have received this e-mail in error please notify the sender and
>> delete it. You may not use, copy or disclose the information in any way.
>>>
>>> Infoshare Ltd monitors incoming and outgoing e-mails.
>>>
>>> Please consider the environment. Do you really need to print this email?
>>
>>
>>
>>
>> --
>> Atte.
>> Moisés Alberto Lindo Gutarra
>> Asesor - Desarrollador Java / Open Source Linux Registered User #431131 -
>> http://counter.li.org/
>> Cel: (511) 995081720 - Rpm: *548913
>> EMail: mlindo@gmail.com
>> MSN: mlindo@tumisolutions.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>>
>> Infoshare Ltd
>> Millennium House
>> 21 Eden Street
>> Kingston upon Thames
>> Surrey
>> KT1 1BL
>> United Kingdom
>>
>> Phone:          + 44 (0) 20 8541 0111
>> Support:        + 44 (0) 20 8481 4760
>> Web:            www.infoshare-is.com
>> E-mail:         info@infoshare-is.com
>>
>> Infoshare Ltd is registered in England and Wales.
>> Registered Office as above.
>> Registered Number 2877612
>> VAT Number GB 678 1443 10
>>
>> The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd.
>> If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.
>>
>> Infoshare Ltd monitors incoming and outgoing e-mails.
>>
>> Please consider the environment. Do you really need to print this email?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
> 
> 
> 


-- 

[key:62590808]


Re: Memory leak in Tomcat

Posted by Moises Alberto Lindo Gutarra <ml...@gmail.com>.
For this type of error you must tuning your apache tomcat for example like this:
 -server -Xms2048m -Xmx2048m -XX:PermSize=128m -XX:MaxPermSize=256m
in Environment Variable JAVA_OPTS into catalina.sh or catalina.bat

2012/2/1 James Annesley <ja...@infoshare-is.com>:
> Tomcat 7.0.25 x64
> RAM= 8GB
> CPU = 8xCPU
> Java = jdk1.6.0_25 x64
>
> I am looking at the tomcat instance in visualvm. I have got eclipse open
> which takes 1 GB. PermGen is close to max. It ran out of PermGen when I
> redeployed.
>
> Is this enough info?
>
> James
>
>
> -----Original Message-----
> From: Moises Alberto Lindo Gutarra [mailto:mlindo@gmail.com]
> Sent: 01 February 2012 16:31
> To: java-user@axis.apache.org
> Subject: Re: Memory leak in Tomcat
>
> can you tell us your tomcat memory configuration and harware ram, cpu, type
> (32 or 64 bits) characteristics???
>
> 2012/2/1 James Annesley <ja...@infoshare-is.com>
>>
>> Hi,
>>
>>
>>
>> I have an XML beans based AXIS 2 1.6.0 stub. After using the client’s UI
> for a short period of time – say a few minutes – having un-deployed the web
> app I get about 50 or so messages as follows:
>>
>>
>>
>> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
>> checkThreadLocalMapForLeaks
>>
>> SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
> [org.apache.xmlbeans.XmlBeans$1] (value
> [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
> [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
> but failed to remove it when the web application was stopped. Threads are
> going to be renewed over time to try and avoid a probable memory leak.
>>
>>
>>
>> Can anyone shed any light on this?
>>
>>
>>
>> Best
>>
>>
>>
>> James
>>
>> Infoshare Ltd
>> Millennium House
>> 21 Eden Street
>> Kingston upon Thames
>> Surrey
>> KT1 1BL
>> United Kingdom
>>
>> Phone: +44 (0) 20 8541 0111
>> Support:  +44 (0) 20 8481 4760
>> Web:  http://www.infoshare-is.com/
>> E-mail:  info@infoshare-is.com
>>
>> Infoshare Ltd is registered in England and Wales.
>> Registered Office as above.
>> Registered Number 2877612
>> VAT Number GB 678 1443 10
>>
>> The content of this e-mail (and any attachment to it) is confidential. Any
> views or opinions do not represent the views or opinions of Infoshare Ltd.
> If you have received this e-mail in error please notify the sender and
> delete it. You may not use, copy or disclose the information in any way.
>>
>> Infoshare Ltd monitors incoming and outgoing e-mails.
>>
>> Please consider the environment. Do you really need to print this email?
>
>
>
>
> --
> Atte.
> Moisés Alberto Lindo Gutarra
> Asesor - Desarrollador Java / Open Source Linux Registered User #431131 -
> http://counter.li.org/
> Cel: (511) 995081720 - Rpm: *548913
> EMail: mlindo@gmail.com
> MSN: mlindo@tumisolutions.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>
> Infoshare Ltd
> Millennium House
> 21 Eden Street
> Kingston upon Thames
> Surrey
> KT1 1BL
> United Kingdom
>
> Phone:          + 44 (0) 20 8541 0111
> Support:        + 44 (0) 20 8481 4760
> Web:            www.infoshare-is.com
> E-mail:         info@infoshare-is.com
>
> Infoshare Ltd is registered in England and Wales.
> Registered Office as above.
> Registered Number 2877612
> VAT Number GB 678 1443 10
>
> The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd.
> If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.
>
> Infoshare Ltd monitors incoming and outgoing e-mails.
>
> Please consider the environment. Do you really need to print this email?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>



-- 
Atte.
Moisés Alberto Lindo Gutarra
Asesor - Desarrollador Java / Open Source
Linux Registered User #431131 - http://counter.li.org/
Cel: (511) 995081720 - Rpm: *548913
EMail: mlindo@gmail.com
MSN: mlindo@tumisolutions.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: Memory leak in Tomcat

Posted by James Annesley <ja...@infoshare-is.com>.
Tomcat 7.0.25 x64
RAM= 8GB
CPU = 8xCPU 
Java = jdk1.6.0_25 x64

I am looking at the tomcat instance in visualvm. I have got eclipse open
which takes 1 GB. PermGen is close to max. It ran out of PermGen when I
redeployed. 

Is this enough info?

James


-----Original Message-----
From: Moises Alberto Lindo Gutarra [mailto:mlindo@gmail.com] 
Sent: 01 February 2012 16:31
To: java-user@axis.apache.org
Subject: Re: Memory leak in Tomcat

can you tell us your tomcat memory configuration and harware ram, cpu, type
(32 or 64 bits) characteristics???

2012/2/1 James Annesley <ja...@infoshare-is.com>
>
> Hi,
>
>
>
> I have an XML beans based AXIS 2 1.6.0 stub. After using the client’s UI
for a short period of time – say a few minutes – having un-deployed the web
app I get about 50 or so messages as follows:
>
>
>
> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader 
> checkThreadLocalMapForLeaks
>
> SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
[org.apache.xmlbeans.XmlBeans$1] (value
[org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
[java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
but failed to remove it when the web application was stopped. Threads are
going to be renewed over time to try and avoid a probable memory leak.
>
>
>
> Can anyone shed any light on this?
>
>
>
> Best
>
>
>
> James
>
> Infoshare Ltd
> Millennium House
> 21 Eden Street
> Kingston upon Thames
> Surrey
> KT1 1BL
> United Kingdom
>
> Phone: +44 (0) 20 8541 0111
> Support:  +44 (0) 20 8481 4760
> Web:  http://www.infoshare-is.com/
> E-mail:  info@infoshare-is.com
>
> Infoshare Ltd is registered in England and Wales.
> Registered Office as above.
> Registered Number 2877612
> VAT Number GB 678 1443 10
>
> The content of this e-mail (and any attachment to it) is confidential. Any
views or opinions do not represent the views or opinions of Infoshare Ltd.
If you have received this e-mail in error please notify the sender and
delete it. You may not use, copy or disclose the information in any way.
>
> Infoshare Ltd monitors incoming and outgoing e-mails.
>
> Please consider the environment. Do you really need to print this email?




--
Atte.
Moisés Alberto Lindo Gutarra
Asesor - Desarrollador Java / Open Source Linux Registered User #431131 -
http://counter.li.org/
Cel: (511) 995081720 - Rpm: *548913
EMail: mlindo@gmail.com
MSN: mlindo@tumisolutions.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org



Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom

Phone: 		+ 44 (0) 20 8541 0111
Support:	+ 44 (0) 20 8481 4760
Web:		www.infoshare-is.com
E-mail:		info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd.
If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Memory leak in Tomcat

Posted by Moises Alberto Lindo Gutarra <ml...@gmail.com>.
can you tell us your tomcat memory configuration and harware ram, cpu,
type (32 or 64 bits) characteristics???

2012/2/1 James Annesley <ja...@infoshare-is.com>
>
> Hi,
>
>
>
> I have an XML beans based AXIS 2 1.6.0 stub. After using the client’s UI for a short period of time – say a few minutes – having un-deployed the web app I get about 50 or so messages as follows:
>
>
>
> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
>
> SEVERE: The web application [/xxxx] created a ThreadLocal with key of type [org.apache.xmlbeans.XmlBeans$1] (value [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
>
>
>
> Can anyone shed any light on this?
>
>
>
> Best
>
>
>
> James
>
> Infoshare Ltd
> Millennium House
> 21 Eden Street
> Kingston upon Thames
> Surrey
> KT1 1BL
> United Kingdom
>
> Phone: +44 (0) 20 8541 0111
> Support:  +44 (0) 20 8481 4760
> Web:  http://www.infoshare-is.com/
> E-mail:  info@infoshare-is.com
>
> Infoshare Ltd is registered in England and Wales.
> Registered Office as above.
> Registered Number 2877612
> VAT Number GB 678 1443 10
>
> The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.
>
> Infoshare Ltd monitors incoming and outgoing e-mails.
>
> Please consider the environment. Do you really need to print this email?




--
Atte.
Moisés Alberto Lindo Gutarra
Asesor - Desarrollador Java / Open Source
Linux Registered User #431131 - http://counter.li.org/
Cel: (511) 995081720 - Rpm: *548913
EMail: mlindo@gmail.com
MSN: mlindo@tumisolutions.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: Memory leak in Tomcat

Posted by James Annesley <ja...@infoshare-is.com>.
Just saw this:

https://issues.apache.org/jira/browse/AXIOM-390

 

From: James Annesley [mailto:james.annesley@infoshare-is.com] 
Sent: 02 February 2012 12:05
To: java-user@axis.apache.org
Subject: RE: Memory leak in Tomcat

 

Thanks for this - very interesting. I have analysed a memory dump and there
are 4698 entries with the ??, i.e., leaking. 

The data comprises as follows:

1)      Most are Static references from a variety of components. 

2)      I have 73  <http://localhost:7000/rootStack/0x78> Java Local
References where the following leak from
org.apache.tomcat.util.threads.TaskThread, java.util.TimerThread,
java.lang.Thread, java.util.TimerThread, java.lang.ref.Finalizer,
java.lang.ref.Reference:

a.        <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl *

b.       <http://localhost:7000/object/0x77cbccfd8>
java.security.SecureClassLoader 

c.        <http://localhost:7000/object/0x77cef6198>
org.apache.catalina.startup.Catalina 

d.       <http://localhost:7000/object/0x78204a5e0>
org.apache.tomcat.util.net.DefaultServerSocketFactory

e.       <http://localhost:7000/object/0x782049bd0>
sun.rmi.transport.tcp.TCPChannel

f.         <http://localhost:7000/object/0x782049ba8>
sun.rmi.transport.tcp.TCPEndpoint

g.        <http://localhost:7000/object/0x781eb4210>
sun.rmi.transport.tcp.TCPTransport

3)      I have 2 JNI Global Reference where the following leak:

a.        <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl *

b.       <http://localhost:7000/object/0x781c25750>
org.apache.tomcat.util.log.SystemLogHandler

c.        <http://localhost:7000/object/0x77ca679d0>
sun.reflect.DelegatingClassLoader

4)      I have 70 System Class References where the following leak:

a.        <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl *

b.       <http://localhost:7000/object/0x77e6fbe90>
javax.management.remote.rmi.NoCallStackClassLoader  

c.        <http://localhost:7000/object/0x77f8a6b68>
org.bouncycastle.jce.provider.BouncyCastleProvider 

d.       <http://localhost:7000/object/0x7837dac20>
org.bouncycastle.jce.provider.JCERSAPublicKey

e.       <http://localhost:7000/object/0x7820055c8>
org.apache.naming.resources.DirContextURLStreamHandlerFactory

f.         <http://localhost:7000/object/0x77e6fbe90>
javax.management.remote.rmi.NoCallStackClassLoader 

g.        <http://localhost:7000/object/0x77e7c08b0>
com.sun.jmx.remote.util.OrderClassLoaders

h.       <http://localhost:7000/object/0x77cbccfd8>
java.security.SecureClassLoader 

i.          <http://localhost:7000/object/0x77d40dcb0>
com.sun.security.auth.PolicyFile

j.         <http://localhost:7000/object/0x77cf04058>
org.apache.tomcat.util.log.SystemLogHandler

k.        <http://localhost:7000/object/0x77e79eba8>
com.sun.jmx.remote.util.ClassLoaderWithRepository 

l.          <http://localhost:7000/object/0x781c13ff0>
org.apache.juli.ClassLoaderLogManager

m.     <http://localhost:7000/object/0x77cbcd420> java.net.URLClassLoader 

n.       <http://localhost:7000/object/0x77cbcd8b8> sun.misc.Launcher 

o.       <http://localhost:7000/object/0x77cbcd420> java.net.URLClassLoader

p.      java.util.logging.LogManager

q.       <http://localhost:7000/object/0x77e67eed8>
javax.management.remote.JMXConnectorServer

r.         <http://localhost:7000/object/0x77e6856d0>
javax.management.remote.rmi.RMIJRMPServerImpl 

s.        <http://localhost:7000/object/0x77e6bcc70>
sun.rmi.server.UnicastRef2

t.         <http://localhost:7000/object/0x77e7a1c70>
javax.management.remote.rmi.RMIConnectionImpl

u.       <http://localhost:7000/object/0x77e68fde8>
sun.rmi.server.UnicastServerRef2

v.        <http://localhost:7000/object/0x781dfee90> java.net.URL

w.      <http://localhost:7000/object/0x781eb8ed0>
sun.rmi.transport.proxy.RMIMasterSocketFactory

x.        <http://localhost:7000/object/0x78373b8b0>
sun.reflect.GeneratedConstructorAccessor35

y.        <http://localhost:7000/object/0x77e6bc008>
sun.rmi.transport.proxy.RMIDirectSocketFactory

z.        <http://localhost:7000/object/0x781cda7b8>
sun.net.www.protocol.jar.JarFileFactory

aa.    <http://localhost:7000/object/0x781eb4210>
sun.rmi.transport.tcp.TCPTransport

 

*  <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl appears in every one in the Java
Local, JNDI and System Class references.

 

The advice I am getting is to ignore these because I am planning to restart
tomcat after every deployment. Just to keep an eye on perm gen once
deployed. It does appear at the very least that axiom is leaking. 

 

One other thing I have done is to remove the log4j library which comes with
AXIS2 and use the following instead:

log4j-over-slf4j-1.6.3.jar

slf4j-api-1.6.3.jar

logback-classic-1.0.0.jar

logback-core-1.0.0.jar

 

Perhaps the logging functions are holding on to something? Can anyone
confirm Axiom has a memory leak?

 

James

 

From: Okken,Brett [mailto:BOKKEN@CERNER.COM] 
Sent: 01 February 2012 19:17
To: java-user@axis.apache.org
Subject: RE: Memory leak in Tomcat

 

 

This is an indication of a ThreadLocal variable being used within the
context of a webapp classloader which did not get cleared out when that
application was stopped. This can lead to PermGen memory errors, as the
classloader cannot be removed. Tomcat does have some logic in it to try and
clean this up (which is what generated the log message below), but it is a
best effort basis. See Frank Kieviet's blog[1] discussing classloader memory
leaks.

 

[1] - http://blogs.oracle.com/fkieviet/entry/how_to_fix_the_dreaded

 

From: James Annesley [mailto:james.annesley@infoshare-is.com] 
Sent: Wednesday, February 01, 2012 10:25 AM
To: java-user@axis.apache.org
Subject: Memory leak in Tomcat

 

Hi,

 

I have an XML beans based AXIS 2 1.6.0 stub. After using the client's UI for
a short period of time - say a few minutes - having un-deployed the web app
I get about 50 or so messages as follows:

 

01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks

SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
[org.apache.xmlbeans.XmlBeans$1] (value
[org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
[java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
but failed to remove it when the web application was stopped. Threads are
going to be renewed over time to try and avoid a probable memory leak.

 

Can anyone shed any light on this?

 

Best

 

James

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom 


Phone: 

+44 (0) 20 8541 0111


Support: 

+44 (0) 20 8481 4760


Web: 

http://www.infoshare-is.com/


E-mail: 

info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10 

The content of this e-mail (and any attachment to it) is confidential. Any
views or opinions do not represent the views or opinions of Infoshare Ltd.
If you have received this e-mail in error please notify the sender and
delete it. You may not use, copy or disclose the information in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails. 

Please consider the environment. Do you really need to print this email?

  _____  

CONFIDENTIALITY NOTICE This message and any included attachments are from
Cerner Corporation and are intended only for the addressee. The information
contained in this message is confidential and may constitute inside or
non-public information under international, federal, or state securities
laws. Unauthorized forwarding, printing, copying, distribution, or use of
such information is strictly prohibited and may be unlawful. If you are not
the addressee, please promptly delete this message and notify the sender of
the delivery error by e-mail or you may call Cerner's corporate offices in
Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom 


Phone: 

+44 (0) 20 8541 0111


Support: 

+44 (0) 20 8481 4760


Web: 

http://www.infoshare-is.com/


E-mail: 

info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10 

The content of this e-mail (and any attachment to it) is confidential. Any
views or opinions do not represent the views or opinions of Infoshare Ltd.
If you have received this e-mail in error please notify the sender and
delete it. You may not use, copy or disclose the information in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails. 

Please consider the environment. Do you really need to print this email?


Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom

Phone: 		+ 44 (0) 20 8541 0111
Support:	+ 44 (0) 20 8481 4760
Web:		www.infoshare-is.com
E-mail:		info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. 
Any views or opinions do not represent the views or opinions 
of Infoshare Ltd.
If you have received this e-mail in error please notify the sender 
and delete it. You may not use, copy or disclose the information 
in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print 
this email?

RE: Memory leak in Tomcat

Posted by James Annesley <ja...@infoshare-is.com>.
Thanks for this - very interesting. I have analysed a memory dump and there
are 4698 entries with the ??, i.e., leaking. 

The data comprises as follows:

1)      Most are Static references from a variety of components. 

2)      I have 73  <http://localhost:7000/rootStack/0x78> Java Local
References where the following leak from
org.apache.tomcat.util.threads.TaskThread, java.util.TimerThread,
java.lang.Thread, java.util.TimerThread, java.lang.ref.Finalizer,
java.lang.ref.Reference:

a.        <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl *

b.       <http://localhost:7000/object/0x77cbccfd8>
java.security.SecureClassLoader 

c.        <http://localhost:7000/object/0x77cef6198>
org.apache.catalina.startup.Catalina 

d.       <http://localhost:7000/object/0x78204a5e0>
org.apache.tomcat.util.net.DefaultServerSocketFactory

e.       <http://localhost:7000/object/0x782049bd0>
sun.rmi.transport.tcp.TCPChannel

f.         <http://localhost:7000/object/0x782049ba8>
sun.rmi.transport.tcp.TCPEndpoint

g.        <http://localhost:7000/object/0x781eb4210>
sun.rmi.transport.tcp.TCPTransport

3)      I have 2 JNI Global Reference where the following leak:

a.        <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl *

b.       <http://localhost:7000/object/0x781c25750>
org.apache.tomcat.util.log.SystemLogHandler

c.        <http://localhost:7000/object/0x77ca679d0>
sun.reflect.DelegatingClassLoader

4)      I have 70 System Class References where the following leak:

a.        <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl *

b.       <http://localhost:7000/object/0x77e6fbe90>
javax.management.remote.rmi.NoCallStackClassLoader  

c.        <http://localhost:7000/object/0x77f8a6b68>
org.bouncycastle.jce.provider.BouncyCastleProvider 

d.       <http://localhost:7000/object/0x7837dac20>
org.bouncycastle.jce.provider.JCERSAPublicKey

e.       <http://localhost:7000/object/0x7820055c8>
org.apache.naming.resources.DirContextURLStreamHandlerFactory

f.         <http://localhost:7000/object/0x77e6fbe90>
javax.management.remote.rmi.NoCallStackClassLoader 

g.        <http://localhost:7000/object/0x77e7c08b0>
com.sun.jmx.remote.util.OrderClassLoaders

h.       <http://localhost:7000/object/0x77cbccfd8>
java.security.SecureClassLoader 

i.          <http://localhost:7000/object/0x77d40dcb0>
com.sun.security.auth.PolicyFile

j.         <http://localhost:7000/object/0x77cf04058>
org.apache.tomcat.util.log.SystemLogHandler

k.        <http://localhost:7000/object/0x77e79eba8>
com.sun.jmx.remote.util.ClassLoaderWithRepository 

l.          <http://localhost:7000/object/0x781c13ff0>
org.apache.juli.ClassLoaderLogManager

m.     <http://localhost:7000/object/0x77cbcd420> java.net.URLClassLoader 

n.       <http://localhost:7000/object/0x77cbcd8b8> sun.misc.Launcher 

o.       <http://localhost:7000/object/0x77cbcd420> java.net.URLClassLoader

p.      java.util.logging.LogManager

q.       <http://localhost:7000/object/0x77e67eed8>
javax.management.remote.JMXConnectorServer

r.         <http://localhost:7000/object/0x77e6856d0>
javax.management.remote.rmi.RMIJRMPServerImpl 

s.        <http://localhost:7000/object/0x77e6bcc70>
sun.rmi.server.UnicastRef2

t.         <http://localhost:7000/object/0x77e7a1c70>
javax.management.remote.rmi.RMIConnectionImpl

u.       <http://localhost:7000/object/0x77e68fde8>
sun.rmi.server.UnicastServerRef2

v.        <http://localhost:7000/object/0x781dfee90> java.net.URL

w.      <http://localhost:7000/object/0x781eb8ed0>
sun.rmi.transport.proxy.RMIMasterSocketFactory

x.        <http://localhost:7000/object/0x78373b8b0>
sun.reflect.GeneratedConstructorAccessor35

y.        <http://localhost:7000/object/0x77e6bc008>
sun.rmi.transport.proxy.RMIDirectSocketFactory

z.        <http://localhost:7000/object/0x781cda7b8>
sun.net.www.protocol.jar.JarFileFactory

aa.    <http://localhost:7000/object/0x781eb4210>
sun.rmi.transport.tcp.TCPTransport

 

*  <http://localhost:7000/object/0x782c6d428>
org.apache.axiom.util.UIDGeneratorImpl appears in every one in the Java
Local, JNDI and System Class references.

 

The advice I am getting is to ignore these because I am planning to restart
tomcat after every deployment. Just to keep an eye on perm gen once
deployed. It does appear at the very least that axiom is leaking. 

 

One other thing I have done is to remove the log4j library which comes with
AXIS2 and use the following instead:

log4j-over-slf4j-1.6.3.jar

slf4j-api-1.6.3.jar

logback-classic-1.0.0.jar

logback-core-1.0.0.jar

 

Perhaps the logging functions are holding on to something? Can anyone
confirm Axiom has a memory leak?

 

James

 

From: Okken,Brett [mailto:BOKKEN@CERNER.COM] 
Sent: 01 February 2012 19:17
To: java-user@axis.apache.org
Subject: RE: Memory leak in Tomcat

 

 

This is an indication of a ThreadLocal variable being used within the
context of a webapp classloader which did not get cleared out when that
application was stopped. This can lead to PermGen memory errors, as the
classloader cannot be removed. Tomcat does have some logic in it to try and
clean this up (which is what generated the log message below), but it is a
best effort basis. See Frank Kieviet's blog[1] discussing classloader memory
leaks.

 

[1] - http://blogs.oracle.com/fkieviet/entry/how_to_fix_the_dreaded

 

From: James Annesley [mailto:james.annesley@infoshare-is.com] 
Sent: Wednesday, February 01, 2012 10:25 AM
To: java-user@axis.apache.org
Subject: Memory leak in Tomcat

 

Hi,

 

I have an XML beans based AXIS 2 1.6.0 stub. After using the client's UI for
a short period of time - say a few minutes - having un-deployed the web app
I get about 50 or so messages as follows:

 

01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks

SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
[org.apache.xmlbeans.XmlBeans$1] (value
[org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
[java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
but failed to remove it when the web application was stopped. Threads are
going to be renewed over time to try and avoid a probable memory leak.

 

Can anyone shed any light on this?

 

Best

 

James

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom 


Phone: 

+44 (0) 20 8541 0111


Support: 

+44 (0) 20 8481 4760


Web: 

http://www.infoshare-is.com/


E-mail: 

info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10 

The content of this e-mail (and any attachment to it) is confidential. Any
views or opinions do not represent the views or opinions of Infoshare Ltd.
If you have received this e-mail in error please notify the sender and
delete it. You may not use, copy or disclose the information in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails. 

Please consider the environment. Do you really need to print this email?

  _____  

CONFIDENTIALITY NOTICE This message and any included attachments are from
Cerner Corporation and are intended only for the addressee. The information
contained in this message is confidential and may constitute inside or
non-public information under international, federal, or state securities
laws. Unauthorized forwarding, printing, copying, distribution, or use of
such information is strictly prohibited and may be unlawful. If you are not
the addressee, please promptly delete this message and notify the sender of
the delivery error by e-mail or you may call Cerner's corporate offices in
Kansas City, Missouri, U.S.A at (+1) (816)221-1024.


Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom

Phone: 		+ 44 (0) 20 8541 0111
Support:	+ 44 (0) 20 8481 4760
Web:		www.infoshare-is.com
E-mail:		info@infoshare-is.com

Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. 
Any views or opinions do not represent the views or opinions 
of Infoshare Ltd.
If you have received this e-mail in error please notify the sender 
and delete it. You may not use, copy or disclose the information 
in any way. 

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print 
this email?

RE: Memory leak in Tomcat

Posted by "Okken,Brett" <BO...@CERNER.COM>.
This is an indication of a ThreadLocal variable being used within the context of a webapp classloader which did not get cleared out when that application was stopped. This can lead to PermGen memory errors, as the classloader cannot be removed. Tomcat does have some logic in it to try and clean this up (which is what generated the log message below), but it is a best effort basis. See Frank Kieviet's blog[1] discussing classloader memory leaks.

[1] - http://blogs.oracle.com/fkieviet/entry/how_to_fix_the_dreaded

From: James Annesley [mailto:james.annesley@infoshare-is.com]
Sent: Wednesday, February 01, 2012 10:25 AM
To: java-user@axis.apache.org
Subject: Memory leak in Tomcat

Hi,

I have an XML beans based AXIS 2 1.6.0 stub. After using the client's UI for a short period of time - say a few minutes - having un-deployed the web app I get about 50 or so messages as follows:

01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/xxxx] created a ThreadLocal with key of type [org.apache.xmlbeans.XmlBeans$1] (value [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Can anyone shed any light on this?

Best

James

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom
Phone:

+44 (0) 20 8541 0111

Support:

+44 (0) 20 8481 4760

Web:

http://www.infoshare-is.com/

E-mail:

info@infoshare-is.com<ma...@infoshare-is.com>


Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

Re: Memory leak in Tomcat

Posted by "Trenton D. Adams" <tr...@athabascau.ca>.
Oh, yes, here's the docs on that.  As you can see, you can write a 
ServletContextListener to unregister the class loader from the logger 
library.

http://wiki.apache.org/commons/Logging/UndeployMemoryLeak

So, if you can find that there is something similar in the library 
you're having a problem with, you should be able to write a small 
ServletContextListener to unregister it as well, assuming the problem is 
similar.

Anyhow, like I said, I just live with it, because typically this is only 
a problem in my workstations, since I redeploy so often.

Le 12-02-02 10:18 AM, Trenton D. Adams a écrit :
> I have seen instances where a library in tomcat itself is the same
> library I'm using, and it is that library that is holding on to a
> reference to the class loader of the webapp. Normally, once the
> classloader is discarded for garbage collection, every reference it
> holds will also end up being garbage collected. But, if a library
> instance from tomcat itself is still holding on to the class loader,
> then that can't happen.
>
> I can't remember why *exactly* this happens, because normally each
> context gets it's own class loader, and therefore a new instance of any
> library in that webapp. But, I believe there was some special stuff
> going on, that caused the library instance in tomcat to get the reference.
>
> If I recall correctly, in my case it was commons logging. I just decided
> to live with it, pump up my permgen, and restart tomcat when needed. :(
>
> Anyhow, I vaguely recall using jvisualvm to diagnose the problem, which
> led me to doing an appropriate google search, and finding that others
> had the same problem with the same library. But, that was a bit of work. :P
>
> Le 12-02-01 09:25 AM, James Annesley a écrit :
>> Hi,
>>
>>
>>
>> I have an XML beans based AXIS 2 1.6.0 stub. After using the client's
>> UI for
>> a short period of time - say a few minutes - having un-deployed the
>> web app
>> I get about 50 or so messages as follows:
>>
>>
>>
>> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
>> checkThreadLocalMapForLeaks
>>
>> SEVERE: The web application [/xxxx] created a ThreadLocal with key of
>> type
>> [org.apache.xmlbeans.XmlBeans$1] (value
>> [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
>> [java.lang.ref.SoftReference] (value
>> [java.lang.ref.SoftReference@1a4d1557])
>> but failed to remove it when the web application was stopped. Threads are
>> going to be renewed over time to try and avoid a probable memory leak.
>>
>>
>>
>> Can anyone shed any light on this?
>>
>>
>>
>> Best
>>
>>
>>
>> James
>>
>>
>> Infoshare Ltd
>> Millennium House
>> 21 Eden Street
>> Kingston upon Thames
>> Surrey
>> KT1 1BL
>> United Kingdom
>>
>> Phone: + 44 (0) 20 8541 0111
>> Support: + 44 (0) 20 8481 4760
>> Web: www.infoshare-is.com
>> E-mail: info@infoshare-is.com
>>
>> Infoshare Ltd is registered in England and Wales.
>> Registered Office as above.
>> Registered Number 2877612
>> VAT Number GB 678 1443 10
>>
>> The content of this e-mail (and any attachment to it) is confidential.
>> Any views or opinions do not represent the views or opinions
>> of Infoshare Ltd.
>> If you have received this e-mail in error please notify the sender
>> and delete it. You may not use, copy or disclose the information
>> in any way.
>>
>> Infoshare Ltd monitors incoming and outgoing e-mails.
>>
>> Please consider the environment. Do you really need to print
>> this email?
>>
>
>


-- 
Trenton D. Adams
Senior Systems Analyst/Web Software Developer
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!

-- 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Memory leak in Tomcat

Posted by "Trenton D. Adams" <tr...@athabascau.ca>.
I have seen instances where a library in tomcat itself is the same 
library I'm using, and it is that library that is holding on to a 
reference to the class loader of the webapp.  Normally, once the 
classloader is discarded for garbage collection, every reference it 
holds will also end up being garbage collected.  But, if a library 
instance from tomcat itself is still holding on to the class loader, 
then that can't happen.

I can't remember why *exactly* this happens, because normally each 
context gets it's own class loader, and therefore a new instance of any 
library in that webapp.  But, I believe there was some special stuff 
going on, that caused the library instance in tomcat to get the reference.

If I recall correctly, in my case it was commons logging.  I just 
decided to live with it, pump up my permgen, and restart tomcat when 
needed. :(

Anyhow, I vaguely recall using jvisualvm to diagnose the problem, which 
led me to doing an appropriate google search, and finding that others 
had the same problem with the same library.  But, that was a bit of work. :P

Le 12-02-01 09:25 AM, James Annesley a écrit :
> Hi,
>
>
>
> I have an XML beans based AXIS 2 1.6.0 stub. After using the client's UI for
> a short period of time - say a few minutes - having un-deployed the web app
> I get about 50 or so messages as follows:
>
>
>
> 01-Feb-2012 16:21:48 org.apache.catalina.loader.WebappClassLoader
> checkThreadLocalMapForLeaks
>
> SEVERE: The web application [/xxxx] created a ThreadLocal with key of type
> [org.apache.xmlbeans.XmlBeans$1] (value
> [org.apache.xmlbeans.XmlBeans$1@561915df ]) and a value of type
> [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@1a4d1557])
> but failed to remove it when the web application was stopped. Threads are
> going to be renewed over time to try and avoid a probable memory leak.
>
>
>
> Can anyone shed any light on this?
>
>
>
> Best
>
>
>
> James
>
>
> Infoshare Ltd
> Millennium House
> 21 Eden Street
> Kingston upon Thames
> Surrey
> KT1 1BL
> United Kingdom
>
> Phone: 		+ 44 (0) 20 8541 0111
> Support:	+ 44 (0) 20 8481 4760
> Web:		www.infoshare-is.com
> E-mail:		info@infoshare-is.com
>
> Infoshare Ltd is registered in England and Wales.
> Registered Office as above.
> Registered Number 2877612
> VAT Number GB 678 1443 10
>
> The content of this e-mail (and any attachment to it) is confidential.
> Any views or opinions do not represent the views or opinions
> of Infoshare Ltd.
> If you have received this e-mail in error please notify the sender
> and delete it. You may not use, copy or disclose the information
> in any way.
>
> Infoshare Ltd monitors incoming and outgoing e-mails.
>
> Please consider the environment. Do you really need to print
> this email?
>


-- 
Trenton D. Adams
Senior Systems Analyst/Web Software Developer
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!

-- 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org