You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tim Allison (JIRA)" <ji...@apache.org> on 2015/10/30 14:46:27 UTC

[jira] [Commented] (TIKA-1784) Use of ThreadLocal in Tika causes memory leaks and warnings in Tomcat

    [ https://issues.apache.org/jira/browse/TIKA-1784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14982572#comment-14982572 ] 

Tim Allison commented on TIKA-1784:
-----------------------------------

Thank you for opening this.  This is caused by POI.  Not sure if it is easily fixable.  Would you be able to open an issue on POI's [bugzilla|https://bz.apache.org/bugzilla/describecomponents.cgi?product=POI] and add a link to here and from here so that we can track this on Tika?

> Use of ThreadLocal in Tika causes memory leaks and warnings in Tomcat
> ---------------------------------------------------------------------
>
>                 Key: TIKA-1784
>                 URL: https://issues.apache.org/jira/browse/TIKA-1784
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.11
>            Reporter: Aleksandr Dubinsky
>            Priority: Minor
>
> Please see this SO discussion: https://stackoverflow.com/questions/13852632/is-it-really-my-job-to-clean-up-threadlocal-resources-when-classes-have-been-exp
> The problem with ThreadLocals is not only do they leak memory in themselves, they actually cause the ClassLoader to stay around and consume permgen.
> Some of the warnings I get are:
> - The web application [ROOT] created a ThreadLocal with key of type [org.apache.poi.extractor.ExtractorFactory$1] (value [org.apache.poi.extractor.ExtractorFactory$1@180f70ad]) and a value of type [java.lang.Boolean] (value [true]) 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.
> - The web application [ROOT] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.store.CharUtil$1] (value [org.apache.xmlbeans.impl.store.CharUtil$1@4d017bd6]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@41099238]) 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.
> - The web application [ROOT] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.store.Locale$1] (value [org.apache.xmlbeans.impl.store.Locale$1@44b3ad91]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@3e2af6cd]) 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.
> - The web application [ROOT] created a ThreadLocal with key of type [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$SchemaTypeLoaderCache$1] (value [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$SchemaTypeLoaderCache$1@36c8b20c]) and a value of type [java.util.ArrayList] (value [[java.lang.ref.SoftReference@2525342a]]) 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.
> - The web application [ROOT] created a ThreadLocal with key of type [org.apache.xmlbeans.XmlBeans$1] (value [org.apache.xmlbeans.XmlBeans$1@67e0d2e5]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@79e0607a]) 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.
> I see that most of the warnings are actually emitted by xmlbeans, but since I'm not knowledgeable about how Tika uses that library or what can be done about it, I'll start the blame chain here and let it trickle down.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)