[CSHARP-3978] High Memory Usage on InsertMany and InsertManyAsync Created: 27/Nov/21 Updated: 28/Oct/23 Resolved: 02/Dec/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Operations |
| Affects Version/s: | None |
| Fix Version/s: | 2.14.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Metin N/A | Assignee: | Boris Dogadov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
I have a basic .NET 6 Application which generates GUID and insert into MongoDB which is running on my local Docker container. The problem I am having is memory usage of C# application is increasing enormously. Here is the insert logic:
I have reviewed memory usage on Visual Studio 2022 Community edition. Here is the memory usage and CancellationTokenSource+CallbackNode is equals to the number of documents inserted to mongodb.
|
| Comments |
| Comment by Githook User [ 02/Dec/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 02/Dec/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by James Kovacs [ 30/Nov/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you for reporting this bug. We have reproduced it in 2.14.0 and are investigating the root cause. We will provide updates and information on a fix in this ticket. Sincerely, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Metin N/A [ 28/Nov/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
And 3rd test with last previous version of the MondoDB driver which is v2.13.3. Memory consumption is stable.
Mongo create script: Same as before Nuget packages:
Application code: Same as before
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Metin N/A [ 28/Nov/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have done 2nd test with previous version of the driver and there is no problem with high memory usage like in the previous test with MongoDB.Driver v2.14.0. Mongo create script:
Nuget packages:
Code: Same with the one in the previous comment.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Metin N/A [ 28/Nov/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello, sorry I didn't create any repository online. This problem occurs for both InsertOne and InsertMany. Here is the more details: Mongo create script:
.NET 6 Console Application: Csproj file
Program.cs file
MongoDB connection string:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Lukyanov (Inactive) [ 28/Nov/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hey dikbas.metin@gmail.com , thank you for your report, please provide the following details:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Metin N/A [ 28/Nov/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Framework: .NET 6.0 Dependencies: MongoDB.Driver v2.14.0 |