<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:49:03 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-60137] Improve Buffer Allocation for Common BSON-related Sizes</title>
                <link>https://jira.mongodb.org/browse/SERVER-60137</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, when we are requesting a piece of memory that might contain a BSON object, it usually requires &lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2598db31541746d191e29f9f7236cb8d9a825774/src/mongo/bson/util/builder.h#L68&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSONObjMaxUserSize&lt;/a&gt;&lt;/tt&gt; bytes (i.e., 16MB) plus a residual amount of memory for its wrapper data structure, which is &lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2598db31541746d191e29f9f7236cb8d9a825774/src/mongo/bson/util/builder.h#L74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSONObjMaxInternalSize&lt;/a&gt;&lt;/tt&gt; bytes (i.e., 16MB+16KB). Then, we ask the buffer builder to allocate this much memory, it &lt;a href=&quot;https://github.com/10gen/mongo/blob/34bb8ccdba458e000b7b0ce7b6c0c157619fcdd6/src/mongo/bson/util/builder.h#L460-L462&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;tries to allocate an amount of memory that&apos;s a power of two&lt;/a&gt;. In this case, it allocates 32MB of memory, which is usually a waste of resources.&lt;/p&gt;

&lt;p&gt;In this ticket, based on the discussions with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bernard.gorman&quot; class=&quot;user-hover&quot; rel=&quot;bernard.gorman&quot;&gt;bernard.gorman&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=redbeard0531&quot; class=&quot;user-hover&quot; rel=&quot;redbeard0531&quot;&gt;redbeard0531&lt;/a&gt;, we want to change the buffer builder logic in the &lt;a href=&quot;https://github.com/10gen/mongo/blob/34bb8ccdba458e000b7b0ce7b6c0c157619fcdd6/src/mongo/bson/util/builder.h#L455&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;grow_reallocate&lt;/tt&gt;&lt;/a&gt; to allocate &lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2598db31541746d191e29f9f7236cb8d9a825774/src/mongo/bson/util/builder.h#L74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSONObjMaxInternalSize&lt;/a&gt;&lt;/tt&gt; bytes if the requested re-allocated amount is anything between &lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2598db31541746d191e29f9f7236cb8d9a825774/src/mongo/bson/util/builder.h#L68&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSONObjMaxUserSize&lt;/a&gt;&lt;/tt&gt; and &lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2598db31541746d191e29f9f7236cb8d9a825774/src/mongo/bson/util/builder.h#L74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BSONObjMaxInternalSize&lt;/a&gt;&lt;/tt&gt; bytes.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1880248">SERVER-60137</key>
            <summary>Improve Buffer Allocation for Common BSON-related Sizes</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="13201">Fixed</resolution>
                                        <assignee username="mohammad.dashti@mongodb.com">Mohammad Dashti</assignee>
                                    <reporter username="mohammad.dashti@mongodb.com">Mohammad Dashti</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Sep 2021 01:19:07 +0000</created>
                <updated>Sun, 29 Oct 2023 21:48:20 +0000</updated>
                            <resolved>Tue, 5 Oct 2021 15:46:10 +0000</resolved>
                                                    <fixVersion>5.1.0-rc0</fixVersion>
                                    <component>Query Execution</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="4106302" author="JIRAUSER1259052" created="Wed, 6 Oct 2021 17:21:22 +0000"  >&lt;p&gt;Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it&#8217;s been triggered. For more active release information, please keep an eye on #server-release. Thank you!&lt;/p&gt;</comment>
                            <comment id="4102583" author="JIRAUSER1259138" created="Tue, 5 Oct 2021 15:45:47 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=redbeard0531&quot; class=&quot;user-hover&quot; rel=&quot;redbeard0531&quot;&gt;redbeard0531&lt;/a&gt; Yeah, it&apos;ll be done in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60115&quot; title=&quot;Fix the Buffer Builder to Correctly use Powers of Two Allocations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60115&quot;&gt;&lt;del&gt;SERVER-60115&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4101848" author="redbeard0531" created="Tue, 5 Oct 2021 11:02:09 +0000"  >&lt;p&gt;This change didn&apos;t adjust for the 8 bytes used for the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c06be6d51a30e00e3fab6e7baaa95e340cd6352d/src/mongo/util/shared_buffer.h#L158-L159&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;SharedBuffer::Holder&lt;/tt&gt;&lt;/a&gt;. Is that coming in a later commit?&lt;/p&gt;</comment>
                            <comment id="4101328" author="xgen-internal-githook" created="Tue, 5 Oct 2021 02:47:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Mohammad Dashti&apos;, &apos;email&apos;: &apos;mdashti@gmail.com&apos;, &apos;username&apos;: &apos;mdashti&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60137&quot; title=&quot;Improve Buffer Allocation for Common BSON-related Sizes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60137&quot;&gt;&lt;del&gt;SERVER-60137&lt;/del&gt;&lt;/a&gt; Improved the buffer allocation for the common BSON-related sizes&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/de1400af129cbe6db8abe12fa39f1e8a96c24c40&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/de1400af129cbe6db8abe12fa39f1e8a96c24c40&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4076450" author="redbeard0531" created="Wed, 22 Sep 2021 07:36:03 +0000"  >&lt;p&gt;BSONObjMaxInternalSize isn&apos;t enough. That is only the maximum size of a single bson object, however this allocation size is for the message, which has an additional envelope structure. I think 16M+64K aught to be enough to not worry about going over, while still having a very low relative overhead (well under 1%).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="579468">SERVER-36346</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1879804">SERVER-60115</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1879816">SERVER-60116</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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>Wed, 22 Sep 2021 07:36:03 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 18 weeks 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 18 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>mohammad.dashti@mongodb.com</customfieldvalue>
            <customfieldvalue>vivian.ge@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i02mnb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="5265">QE 2021-10-04</customfieldvalue>
    <customfieldvalue id="5267">QE 2021-10-18</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|i028sn:</customfieldvalue>

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