I have verified using mongoc-stat , Valgrind, and ASAN that no memory leaks are appearing in my code.
However, when executing this mongoc_cursor_next(), the memory in my program rises considerably. This is expected as i am reading in potentially hundresds of thousands of documents. The memory drops at the end after the cursor_destroy(), but not to what it was before.
Each time this code is executed, the memory of my program has remained higher each time. Eventually after many executions i run out of memory.
This code is executed for multiple collections with individual document sizes ranging from a couple hundred Bytes, to 1MB or so per document.
valgrind doesnt show any leaks. the issue only happens during the reads from mongoc_cursor_next(). I have investigated all other areas of code and they are not causing this issue.
if i comment out all my index logic, and all my writing of documents, there are no problems.
i have been tracking the ‘RES’ memory of my process via the top command. This is what i see increasing when i execute this code.
this code is in a for loop called for multiple collections, some of them are small collections, some of them are large. Some of these collections have very large documents, some are very small.
Nothing seems out of the order on a quick glance. Running that example locally with ASAN also does not report leaks.
Do you have a sample collection that can be used to reproduce the issue?
New & Unread Topics
Topic list, column headers with buttons are sortable.