<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:56 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-732] Thread Locals not being freed in thread pool</title>
                <link>https://jira.mongodb.org/browse/JAVA-732</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We are seeing thread local data being left on threads in the thread&lt;br/&gt;
pool of our application running in Tomcat 7 causing a memory leak.&lt;br/&gt;
This problem is not unique to us. The JIRA issues below are described&lt;br/&gt;
by your customers experiencing similar problems&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-596&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/JAVA-596&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-130&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/JAVA-130&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-236&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/JAVA-236&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-236&quot; title=&quot;Slow memory leak caused by non-static ThreadLocal in DBTCPConnector&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-236&quot;&gt;&lt;del&gt;JAVA-236&lt;/del&gt;&lt;/a&gt;, the issue is closed but it does not address the issue.&lt;br/&gt;
The patch seems to miss the point: we want to free the TLS, not close&lt;br/&gt;
the connection.&lt;/p&gt;

&lt;p&gt;Here is the patch we have introduced to your 2.9.10 distribution:&lt;/p&gt;

&lt;p&gt;&amp;#8212; src/main/com/mongodb/DBTCPConnector.java.orig       2012-12-03&lt;br/&gt;
12:39:49.000000000 -0700&lt;br/&gt;
+++ src/main/com/mongodb/DBTCPConnector.java    2012-12-11&lt;br/&gt;
08:04:11.000000000 -0700&lt;br/&gt;
@@ -608,6 +608,15 @@&lt;br/&gt;
     }&lt;/p&gt;

&lt;p&gt;     /**&lt;br/&gt;
+     * Release thread local storage for invoking thread. This should&lt;br/&gt;
be called for threads&lt;br/&gt;
+     * in thread pools implemented as part of a web framework per&lt;br/&gt;
request. It is not required&lt;br/&gt;
+     * for the thread invoking close().&lt;br/&gt;
+     */&lt;br/&gt;
+    public void release() &lt;/p&gt;
{
+        _myPort.remove();
+    }
&lt;p&gt;+&lt;br/&gt;
+    /**&lt;/p&gt;</description>
                <environment>Java </environment>
        <key id="61970">JAVA-732</key>
            <summary>Thread Locals not being freed in thread pool</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="dtaylor@marketlive.com">David Taylor</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Jan 2013 03:05:18 +0000</created>
                <updated>Sun, 10 Mar 2013 02:22:11 +0000</updated>
                            <resolved>Sun, 10 Mar 2013 02:22:11 +0000</resolved>
                                    <version>2.10.1</version>
                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="285420" author="jeff.yemin" created="Sun, 10 Mar 2013 02:21:33 +0000"  >&lt;p&gt;Duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-595&quot; title=&quot;With redeploy web app created a ThreadLocal but failed to remove it when the web application was stopped &quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-595&quot;&gt;&lt;del&gt;JAVA-595&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="281708" author="oallouch" created="Tue, 5 Mar 2013 12:47:39 +0000"  >&lt;p&gt;Reloading my webapp causes PermGen exceptions. It may be related to this issue.&lt;br/&gt;
Btw, for my local ThreadLocals (dealing with SimpleDateFormats), setting the references to null works.&lt;/p&gt;</comment>
                            <comment id="242106" author="dtaylor@marketlive.com" created="Thu, 17 Jan 2013 03:23:39 +0000"  >&lt;p&gt;We have not yet experienced any side effects, though we are concerned with thread pool reused state. Tomcat tries to deal with this by killling the threads in the thread pool. We dont know how successful they are because we dont reload Tomcat (currently). Having SEVERE errors in the logs that we have to train others to ignore is not &quot;correct behavior&quot;&lt;/p&gt;</comment>
                            <comment id="242096" author="jeff.yemin" created="Thu, 17 Jan 2013 03:06:14 +0000"  >&lt;p&gt;My question is really about whether you are seeing any actual problems in the behavior of your application, or is it only the Tomcat reports that are a concern? Either way it&apos;s a problem, but it&apos;s more serious if there is incorrect behavior in addition to the warnings from Tomcat.&lt;/p&gt;</comment>
                            <comment id="240668" author="dtaylor@marketlive.com" created="Tue, 15 Jan 2013 19:32:22 +0000"  >&lt;p&gt;&lt;a href=&quot;http://wiki.apache.org/tomcat/MemoryLeakProtection&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://wiki.apache.org/tomcat/MemoryLeakProtection&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="240621" author="dtaylor@marketlive.com" created="Tue, 15 Jan 2013 18:41:03 +0000"  >&lt;p&gt;With no API available to clear the TLS state, TLS memory is left on the web request threads. In a pooled request thread environment, these can result in cross request state contamination. furthermore, web application reloading cannot complete properly as long as these threads hold onto these objects in unloaded applications. Tomcat reports these TLS leaks per thread on shutdown as a diagnositic tool to warn developers of these portential problems.&lt;/p&gt;</comment>
                            <comment id="240398" author="jeff.yemin" created="Tue, 15 Jan 2013 14:43:07 +0000"  >&lt;p&gt;Hi David,&lt;/p&gt;

&lt;p&gt;Can you characterize the seriousness of the problem?  Is it that memory is being wasted, or that the application is behaving incorrectly as a result?  &lt;/p&gt;

&lt;p&gt;Are you calling this release method at the end of every request?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="43246">JAVA-595</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrllj3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>39533</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>