<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:41:46 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>[CSHARP-2159] Bson.IO.Bytebuffer never dispose </title>
                <link>https://jira.mongodb.org/browse/CSHARP-2159</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I Have an application using mongodb,for data storage,&lt;br/&gt;
but when request in my application grow,application memory grow too,and when load going down memory not released , i going to check application with memory profiler application(ANTS &lt;br/&gt;
memory profiler)  when check the result i saw Bson.IO.Bytebuffer instance get the all memory &lt;/p&gt;

&lt;p&gt;iam using replica set with three server,.net application,and one static instance for mongo client &lt;br/&gt;
for all thread,&lt;/p&gt;

&lt;p&gt;my connection settings in application &lt;/p&gt;


&lt;p&gt;            var mongoSetting = new MongoClientSettings()&lt;br/&gt;
            {&lt;br/&gt;
                MaxConnectionPoolSize = 7500,&lt;br/&gt;
                Servers = mongoServerAddress,&lt;br/&gt;
                ConnectionMode = ConnectionMode.ReplicaSet,&lt;br/&gt;
                ReplicaSetName = &quot;switch&quot;,&lt;br/&gt;
                 ClusterConfigurator = builder =&amp;gt;&lt;br/&gt;
                &lt;/p&gt;
{
                    builder.ConfigureCluster
                    (settings =&amp;gt; settings.With(serverSelectionTimeout: TimeSpan.FromSeconds(2)));
                }
&lt;p&gt;,&lt;/p&gt;



&lt;p&gt;            };&lt;/p&gt;



&lt;p&gt;the image attached is the result of ANTS application  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;177057_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/177057/177057_Untitled.png&quot; title=&quot;Untitled.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;177057&quot; file-preview-title=&quot;Untitled.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/177057/_thumb_177057.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;</description>
                <environment></environment>
        <key id="488364">CSHARP-2159</key>
            <summary>Bson.IO.Bytebuffer never dispose </summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="sohil_ww">soheil karami</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Sun, 28 Jan 2018 11:03:10 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:10 +0000</updated>
                            <resolved>Fri, 31 Aug 2018 21:22:49 +0000</resolved>
                                    <version>2.5</version>
                                                    <component>API</component>
                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1790598" author="rstam" created="Wed, 31 Jan 2018 15:59:23 +0000"  >&lt;p&gt;Regarding RawBsonDocument and RawBsonArray, we believe it would be a common application error to forget to call Dispose on them, which would prevent the underlying byte buffer from being returned to the pool.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1110&quot; title=&quot;Make RawBsonDocument.dispose() an no-op&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1110&quot;&gt;CSHARP-1110&lt;/a&gt; proposes having RawBsonDocument and RawBsonArray make a copy of the bytes so that the application is no longer burdened with the responsibility of calling Dispose.&lt;/p&gt;</comment>
                            <comment id="1790594" author="rstam" created="Wed, 31 Jan 2018 15:57:32 +0000"  >&lt;p&gt;ByteBuffer instances are cached in a pool to be reused later, so it is normal for them not to be released.&lt;/p&gt;

&lt;p&gt;This would only be a bug if you were seeing memory use going up forever.&lt;/p&gt;

&lt;p&gt;Instances of RawBsonDocument and RawBsonArray also reference bytes in an underlying ByteBuffer and prevent them from being returned to the pool until the RawBsonDocument or RawBsonArray is disposed. It is possible that you are holding to RawBsonDocument or RawBsonArray instances in your application.&lt;/p&gt;

&lt;p&gt;Can you confirm whether you are seeing runaway memory or use? Or are you simply observing the cached instances?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="170388">CSHARP-1110</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="177057" name="Untitled.png" size="151259" author="sohil_ww" created="Sun, 28 Jan 2018 10:33:05 +0000"/>
                    </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|htggf3:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>