Memory leaks in Tomcat due to ThreadLocals are improved and perhaps fixed by the later versions of tomcat.

(7.0.6 according to this document: http://wiki.apache.org/tomcat/MemoryLeakProtection ). 

"Starting with Tomcat 7.0.6, the threads of the pool are renewed so that the leak is safely fixed."

fwiw

cheers

-alan




De : Michael Kay <mike@saxonica.com>
A: stephenksamuel@gmail.com, Mailing list for the SAXON XSLT and XQuery processor <saxon-help@lists.sourceforge.net>
Date: 04/30/2012 01:05 PM
Objet : Re: [saxon] Memory Leaks





OK, I've been slowly convinced that ThreadLocals are more trouble than they are worth, so I'll get rid of this one as well.

Michael Kay
Saxonica

On 30/04/2012 11:31, Sam (Stephen Samuel) wrote:

Great on 1481.

The issue with the caching is not about it using up the explicitly cached resources, its about the ThreadLocals keeping a reference to the web-app classloader meaning the entire webapp's Class instances cannot be gc'ed (thus leading to perm gen explosion).

My profiler reported all three instances of ThreadLocal's being kept around.

On Mon, Apr 30, 2012 at 11:23, Michael Kay <mike@saxonica.com> wrote:
The issue with the converter cache will be fixed in the next maintenance release: see

http://dev.saxonica.com/community/issues/1481

I haven't seen evidence that the URI cache causes similar problems. In this case the objects held in the cache are simple strings and booleans so it shouldn't lock down any significant resources. If you do believe it is causing a problem, you can always set the Configuration property FeatureKeys.XSD_VERSION to "1.1", in which case the StandardURIChecker will not be used (in XSD 1.1, all strings are valid for xs:anyURI).

Michael Kay
Saxonica



On 30/04/2012 10:30, Sam (Stephen Samuel) wrote:

Hi,

Saxon 9.4 has a couple of memory leak issues when used in a Tomcat container. The issue is the use of the ThreadLocal's in the following classes.

StandardURIChecker
ConversionRules

Basically the thread locals are created by the webapp classloader, which means that they hold a reference to that classloader, so it cannot be released.

We need someway of clearing these. I couldn't see when a Configuration is created / freed.

--
-Sam



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--
-Sam



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help ------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



Ensemble adoptons des gestes responsables : N'imprimez ce mail que si necessaire. Les informations contenues dans ce message et les pieces jointes (ci-apres denomme le message) sont confidentielles et peuvent etre couvertes par le secret professionnel. Si vous n'etes pas le destinataire de ce message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez recu ce message par erreur, nous vous remercions de le supprimer de votre systeme, ainsi que toutes ses copies, et d'en avertir immediatement HSBC France et ses filiales par message de retour. Il est impossible de garantir que les communications par messagerie electronique arrivent en temps utile, sont securisees ou denuees de toute erreur, alteration, falsification ou virus. En consequence, HSBC France et ses filiales declinent toute responsabilite du fait des erreurs, alterations, falsifications ou omissions qui pourraient en resulter. Consider the environment before printing this mail. The information contained in this e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message by error, please delete it and all copies from your system and notify the sender immediately by return e-mail. E-mail communications cannot be guaranteed to be timely secure, error or virus-free. The sender does not accept liability for any errors or omissions which arise as a result.