<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:23:28 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>[SERVER-10554] memory leak in MutableDocument::setNestedField</title>
                <link>https://jira.mongodb.org/browse/SERVER-10554</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #EEEEEE;border-color: #ccc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-color: #ccc;background-color: #6CB33F;&quot;&gt;&lt;b&gt;Issue Status as of October 23rd, 2013&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;p&gt;&lt;b&gt;ISSUE SUMMARY&lt;/b&gt;&lt;br/&gt;
Memory leak in aggregation in MutableDocument::setNestedField&lt;/p&gt;

&lt;p&gt;&lt;b&gt;USER IMPACT&lt;/b&gt;&lt;br/&gt;
This leak can manifest in two different scenarios:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Accessing nested fields in the original document fetched from the collection. This leads to a leak of a few hundred bytes per aggregation command. The amount of memory leaked in this case does not depend on the amount of data processed in the aggregation. If the nested fields are only used by a $match expression but not any other pipeline stages, this leak does not apply.&lt;/li&gt;
	&lt;li&gt;Using a $geoNear pipeline stage and using distanceField or includeLocs to inject information into a nested field. This results in a leak of a few hundred bytes per document returned from geoNear.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;It is present in versions of MongoDB prior to and including v2.4.6.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;SOLUTION&lt;/b&gt;&lt;br/&gt;
Fix ref counting of NULL pointers in MutableDocument.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;WORKAROUNDS&lt;/b&gt;&lt;br/&gt;
None.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;PATCHES&lt;/b&gt;&lt;br/&gt;
Production release v2.4.7 contains the fix for this issue, and production release v2.6.0 will contain the fix as well.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h4&gt;&lt;a name=&quot;OriginalDescription&quot;&gt;&lt;/a&gt;Original Description&lt;/h4&gt;

&lt;p&gt;Aggregation queries are causing memory leak on primary.  Detected by comparing &lt;a href=&quot;http://support.microsoft.com/kb/268343&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;umdh memory dumps&lt;/a&gt; before and after running aggregation.&lt;/p&gt;

&lt;p&gt;There are two cases in the current codebase that can cause this leak:&lt;/p&gt;

&lt;p&gt;1) Accessing nested fields in the original document fetched from the collection. This leads to a leak of a few hundred bytes per aggregation command. The amount of memory leaked in this case does not depend on the amount of data processed in the aggregation. If the nested fields are only used by a $match expression but not any other pipeline stages, this leak does not apply.&lt;/p&gt;

&lt;p&gt;2) Using a $geoNear pipeline stage and using distanceField or includeLocs to inject information into a nested field. This results in a leak of a few hundred bytes per documented returned from geoNear.&lt;/p&gt;</description>
                <environment>Win2008R2&lt;br/&gt;
3-node replica set</environment>
        <key id="86330">SERVER-10554</key>
            <summary>memory leak in MutableDocument::setNestedField</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="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="alex.komyagin@mongodb.com">Alexander Komyagin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 16 Aug 2013 23:01:56 +0000</created>
                <updated>Mon, 11 Jul 2016 17:37:21 +0000</updated>
                            <resolved>Mon, 19 Aug 2013 20:05:48 +0000</resolved>
                                    <version>2.4.5</version>
                                    <fixVersion>2.4.7</fixVersion>
                    <fixVersion>2.5.2</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="410305" author="auto" created="Fri, 23 Aug 2013 20:50:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: Add check to prevent future memory leaks like &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10554&quot; title=&quot;memory leak in MutableDocument::setNestedField&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10554&quot;&gt;&lt;del&gt;SERVER-10554&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: v2.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/26f638873eadfc3dd8e17bb37eb68a1c613146c3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/26f638873eadfc3dd8e17bb37eb68a1c613146c3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="410304" author="auto" created="Fri, 23 Aug 2013 20:50:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10554&quot; title=&quot;memory leak in MutableDocument::setNestedField&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10554&quot;&gt;&lt;del&gt;SERVER-10554&lt;/del&gt;&lt;/a&gt; Patch memory leak in aggregation&lt;/p&gt;

&lt;p&gt;The issue was that empty documents are represented as a NULL pointer and&lt;br/&gt;
Value didn&apos;t ref count NULL pointers. This is fine for all public&lt;br/&gt;
interactions with Value, however MutableDocument can change the pointer&lt;br/&gt;
in-place when updating a nested field. This caused a leak when it&lt;br/&gt;
transitioned a Value from holding a non-refcounted NULL pointer to&lt;br/&gt;
holding a real pointer since MutableDocument/MutableValue didn&apos;t set the&lt;br/&gt;
refCount bit.&lt;br/&gt;
Branch: v2.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/cc9361ee7e40cb087d779eef7e10b2225c7ff8f7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/cc9361ee7e40cb087d779eef7e10b2225c7ff8f7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="406645" author="auto" created="Mon, 19 Aug 2013 19:55:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: Add check to prevent future memory leaks like &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10554&quot; title=&quot;memory leak in MutableDocument::setNestedField&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10554&quot;&gt;&lt;del&gt;SERVER-10554&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/33342134b8a72434b4281296740ff14f60c20c77&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/33342134b8a72434b4281296740ff14f60c20c77&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="406644" author="auto" created="Mon, 19 Aug 2013 19:55:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10554&quot; title=&quot;memory leak in MutableDocument::setNestedField&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10554&quot;&gt;&lt;del&gt;SERVER-10554&lt;/del&gt;&lt;/a&gt; Patch memory leak in aggregation&lt;/p&gt;

&lt;p&gt;The issue was that empty documents are represented as a NULL pointer and&lt;br/&gt;
Value didn&apos;t ref count NULL pointers. This is fine for all public&lt;br/&gt;
interactions with Value, however MutableDocument can change the pointer&lt;br/&gt;
in-place when updating a nested field. This caused a leak when it&lt;br/&gt;
transitioned a Value from holding a non-refcounted NULL pointer to&lt;br/&gt;
holding a real pointer since MutableDocument/MutableValue didn&apos;t set the&lt;br/&gt;
refCount bit.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6fea4eb1774119e6431bf251d008d062c67c73f2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6fea4eb1774119e6431bf251d008d062c67c73f2&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 16 Aug 2013 23:43:25 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 25 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 25 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alex.komyagin@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmj9j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrsb7j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>79045</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjcvr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>