-
Type: Question
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Python version: 3.8.10, 3.8.11
pymongo version: 4.3.3
Hello!
Faced a very strange behavior that looks like a memory leak.
Briefly about the purpose of this operation and my expectations: this [^mongo_leak_test.py] script (a very simplified mechanism for working with documents that I use in my library) has the goal of iterating over thousands of documents from a collection. While using this script, I expect that every time the function is called, after it ends, all the memory that was used will be freed to the initial state.
At this stage, I see that after each call, the memory is freed, but not completely, each new 1000 documents (which was not previously in the search, as I understand it) pymongo cursor(potentially) takes + 15mb to the initial state.
This can also be seen on the graph from the memray profiler:
I'm somewhat unsure of the specific root cause of this problem, so I'm hoping for your help.[^mongo_leak_test.py]
- is related to
-
PYTHON-3982 Investigate possible memory leak
- Closed
- related to
-
MOTOR-1231 Allocated memory increases over time
- Closed