[jira] Created: (SOLR-2357) Thread Local memory leaks on restart

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)
Thread Local memory leaks on restart
------------------------------------

                 Key: SOLR-2357
                 URL: https://issues.apache.org/jira/browse/SOLR-2357
             Project: Solr
          Issue Type: Bug
          Components: contrib - Solr Cell (Tika extraction), search
    Affects Versions: 1.4.1
         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
            Reporter: Gus Heck


Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.

SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
o remove it when the web application was stopped. Threads are going to be renewe
d over time to try and avoid a probable memory leak.
Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
LocalMapForLeaks

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)

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

Jan Høydahl commented on SOLR-2357:
-----------------------------------

I've seen this as well in this variant:
{code}
SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.apache.solr.schema.DateField.ThreadLocalDateFormat] (value [org.apache.solr.schema.DateField$ThreadLocalDateFormat@2b495510]) and a value of type [org.apache.solr.schema.DateField.ISO8601CanonicalDateFormat] (value [org.apache.solr.schema.DateField$ISO8601CanonicalDateFormat@6b2ed43a]) 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.
4-apr-2011 13:30:11 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
{code}
Seems to only happen with Dates?

> Thread Local memory leaks on restart
> ------------------------------------
>
>                 Key: SOLR-2357
>                 URL: https://issues.apache.org/jira/browse/SOLR-2357
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - Solr Cell (Tika extraction), search
>    Affects Versions: 1.4.1
>         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
>            Reporter: Gus Heck
>              Labels: memory_leak, threadlocal
>
> Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.
> SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
> apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
> common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
> ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
> o remove it when the web application was stopped. Threads are going to be renewe
> d over time to try and avoid a probable memory leak.
> Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
> LocalMapForLeaks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Jan Høydahl commented on SOLR-2357:
-----------------------------------

The offending piece of code is in org.apache.solr.schema.DateField:
{code}
  private final static ThreadLocalDateFormat fmtThreadLocal
    = new ThreadLocalDateFormat(new ISO8601CanonicalDateFormat());
{code}

How can we avoid that Tomcat complains about the possible memory leak? finalize() won't work for final variables.

> Thread Local memory leaks on restart
> ------------------------------------
>
>                 Key: SOLR-2357
>                 URL: https://issues.apache.org/jira/browse/SOLR-2357
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - Solr Cell (Tika extraction), search
>    Affects Versions: 1.4.1
>         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
>            Reporter: Gus Heck
>              Labels: memory_leak, threadlocal
>
> Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.
> SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
> apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
> common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
> ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
> o remove it when the web application was stopped. Threads are going to be renewe
> d over time to try and avoid a probable memory leak.
> Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
> LocalMapForLeaks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Mark Miller commented on SOLR-2357:
-----------------------------------

Perhaps clear it out in SolrDispatchFilter#destroy?

> Thread Local memory leaks on restart
> ------------------------------------
>
>                 Key: SOLR-2357
>                 URL: https://issues.apache.org/jira/browse/SOLR-2357
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - Solr Cell (Tika extraction), search
>    Affects Versions: 1.4.1
>         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
>            Reporter: Gus Heck
>              Labels: memory_leak, threadlocal
>
> Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.
> SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
> apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
> common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
> ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
> o remove it when the web application was stopped. Threads are going to be renewe
> d over time to try and avoid a probable memory leak.
> Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
> LocalMapForLeaks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Yonik Seeley commented on SOLR-2357:
------------------------------------

bq. Perhaps clear it out in SolrDispatchFilter#destroy?

Or CoreContainer.shutdown()?

It could perhaps be made more generic through registering callbacks to be run on shutdown, but perhaps not so important if there are just a few.

> Thread Local memory leaks on restart
> ------------------------------------
>
>                 Key: SOLR-2357
>                 URL: https://issues.apache.org/jira/browse/SOLR-2357
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - Solr Cell (Tika extraction), search
>    Affects Versions: 1.4.1
>         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
>            Reporter: Gus Heck
>              Labels: memory_leak, threadlocal
>
> Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.
> SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
> apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
> common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
> ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
> o remove it when the web application was stopped. Threads are going to be renewe
> d over time to try and avoid a probable memory leak.
> Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
> LocalMapForLeaks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Hoss Man commented on SOLR-2357:
--------------------------------

Generalized (core) shutdown hooks seem like they might be a decent idea ... but that introduces more life cycle complications (and i feel like we already have plenty)

the simplest solution seems like it would probably be to just have something like CoreContainer or SolrCore manage a single ThreadLocal object (probably a Map<Object,Object>) that *any* component in solr could attempt to us to stash persistent data in, and then the initial creator would just be responsible for cleaning up that object.

> Thread Local memory leaks on restart
> ------------------------------------
>
>                 Key: SOLR-2357
>                 URL: https://issues.apache.org/jira/browse/SOLR-2357
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - Solr Cell (Tika extraction), search
>    Affects Versions: 1.4.1
>         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
>            Reporter: Gus Heck
>              Labels: memory_leak, threadlocal
>
> Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.
> SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
> apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
> common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
> ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
> o remove it when the web application was stopped. Threads are going to be renewe
> d over time to try and avoid a probable memory leak.
> Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
> LocalMapForLeaks

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-2357) Thread Local memory leaks on restart

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Doug Ivison commented on SOLR-2357:
-----------------------------------

Two weeks ago, this:  https://issues.apache.org/bugzilla/show_bug.cgi?id=52850 
...improved memory leak detection & fixing, for Tomcat 7.

Will that help with this?

((Aside:  since our application vendor's official support is still for Tomcat 6, I hope that Konstantin's comment at bottom makes a difference -- proposing that same fix for Tomcat 6.))
               

> Thread Local memory leaks on restart
> ------------------------------------
>
>                 Key: SOLR-2357
>                 URL: https://issues.apache.org/jira/browse/SOLR-2357
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - Solr Cell (Tika extraction), search
>    Affects Versions: 1.4.1
>         Environment: Windows Server 2008, Apache Tomcat 7.0.8, Java 1.6.23
>            Reporter: Gus Heck
>              Labels: memory_leak, threadlocal
>
> Restarting solr (via a changed to a watched resource or via manager app for example) after submitting documents with Solr-Cell, gives the following message (many many times), and causes Tomcat to shutdown completely.
> SEVERE: The web application [/solr] created a ThreadLocal with key of type [org.
> apache.solr.common.util.DateUtil.ThreadLocalDateFormat] (value [org.apache.solr.
> common.util.DateUtil$ThreadLocalDateFormat@dc30dfa]) and a value of type [java.t
> ext.SimpleDateFormat] (value [java.text.SimpleDateFormat@5af7aed5]) but failed t
> o remove it when the web application was stopped. Threads are going to be renewe
> d over time to try and avoid a probable memory leak.
> Feb 10, 2011 7:17:53 AM org.apache.catalina.loader.WebappClassLoader checkThread
> LocalMapForLeaks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]