<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:09:21 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>[CDRIVER-394] memory leak with mongo tail api </title>
                <link>https://jira.mongodb.org/browse/CDRIVER-394</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;I am using mongo TAILABLE cursor to read from mongod server. Notice that when the daemon is running for a long time , the process memory consumption keeps increasing. So used valgrind to check for memeory leak.&lt;br/&gt;
I get below out put from valgrind&lt;br/&gt;
-----------------------------------------------&lt;br/&gt;
==00:00:08:55.814 17673== 151,848 (123,120 direct, 28,728 indirect) bytes in 513 blocks are definitely lost in loss record 270 of 272&lt;br/&gt;
==00:00:08:55.815 17673==    at 0x4C229FE: malloc (vg_replace_malloc.c:291)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x4E3104C: bson_malloc (bson.c:952)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x4E3735F: mongo_find (mongo.c:1243)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x40482A: start_threshold_mongo_log_tailable (mongotosqlite_main.c:481)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x619AFC6: start_thread (in /lib64/libpthread-2.8.so)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x6A097AC: clone (in /lib64/libc-2.8.so)&lt;br/&gt;
==00:00:08:55.815 17673==&lt;br/&gt;
==00:00:08:55.815 17673== 745,644 (599,280 direct, 146,364 indirect) bytes in 2,497 blocks are definitely lost in loss record 271 of 272&lt;br/&gt;
==00:00:08:55.815 17673==    at 0x4C229FE: malloc (vg_replace_malloc.c:291)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x4E3104C: bson_malloc (bson.c:952)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x4E3735F: mongo_find (mongo.c:1243)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x4050A8: start_mongo_log_tailable (mongotosqlite_main.c:724)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x619AFC6: start_thread (in /lib64/libpthread-2.8.so)&lt;br/&gt;
==00:00:08:55.815 17673==    by 0x6A097AC: clone (in /lib64/libc-2.8.so)&lt;br/&gt;
==00:00:08:55.815 17673==&lt;br/&gt;
--------------------------------------------------------------------------------------------&lt;br/&gt;
Following is the code snippet.&lt;br/&gt;
while(1)&lt;br/&gt;
{&lt;br/&gt;
if(mongo_check_connection (my_client) == MONGO_ERROR )&lt;/p&gt;
    {
       closeMongoConnection(log_type);
       syslog(LOG_LOCAL0, &quot;Mongo db connection lost for log type: %d Reconnecting&quot;,log_type);
       my_client = create_mongo_client(log_type,table_name);
    }
&lt;p&gt;    cursor = mongo_find( my_client,table_name , &amp;amp;b, bson_empty( &amp;amp;e ), 0, 0, MONGO_TAILABLE);&lt;br/&gt;
.....&lt;br/&gt;
}// end of mongo_check_connection (my_client) &lt;br/&gt;
  bson_destroy( &amp;amp;b );&lt;br/&gt;
    bson_init( &amp;amp;b );&lt;br/&gt;
    bson_append_start_object( &amp;amp;b, &quot;_id&quot; );&lt;br/&gt;
    bson_append_oid( &amp;amp;b, &quot;$gt&quot;, &amp;amp;id );&lt;br/&gt;
    bson_append_finish_object( &amp;amp;b );&lt;br/&gt;
    bson_finish( &amp;amp;b );&lt;br/&gt;
}&lt;br/&gt;
------------------------------------------------------&lt;br/&gt;
Can you please advise what is the issue and how to fix?&lt;br/&gt;
I thought of upgrading to latest c-driver. But my application runs on 32 bit system.&lt;br/&gt;
Please assist.&lt;/p&gt;</description>
                <environment>linux</environment>
        <key id="147399">CDRIVER-394</key>
            <summary>memory leak with mongo tail api </summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="asethy">Arati Sethy</reporter>
                        <labels>
                            <label>driver</label>
                    </labels>
                <created>Wed, 16 Jul 2014 03:35:56 +0000</created>
                <updated>Wed, 11 Sep 2019 19:04:36 +0000</updated>
                            <resolved>Wed, 16 Jul 2014 19:13:16 +0000</resolved>
                                    <version>0.7</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="660979" author="christian.hergert@10gen.com" created="Wed, 16 Jul 2014 19:13:16 +0000"  >&lt;p&gt;Marking duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-395&quot; title=&quot;Need clarification on mongo c-driver&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-395&quot;&gt;&lt;del&gt;CDRIVER-395&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <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|hs0jef:</customfieldvalue>

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