[GODRIVER-3007] Slow memory leak in the official MongoDB Go packages Created: 07/Oct/23  Updated: 09/Jan/24  Resolved: 09/Jan/24

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 1.12.0, 1.12.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Michael Gardner Assignee: Matt Dale
Resolution: Gone away Votes: 0
Labels: leak, memory-leak
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive project-service-pprof-1.zip    
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Detailed steps to reproduce the problem?

After launching the project-service in a pod in Kubernetes (AKS, mostly current release), it works properly and has reasonable resource consumption.
After a few days, the memory consumption has steadily increased/ramped-up, as a slow pace despite the service not being accessed.
Please view the image entitled: 20231006_191500MST_LEAK_K8S_Resources.png.

Definition of done: what must be done to consider the task complete?

Launch our web service and send a few queries to pull data from the Atlas MongoDB database.  
Let the web service be inactive, but connected via a Mongo Client to the database for 24-hours.
Examine the memory consumption over 24-hours.  If the level remains fairly constant, due to the api being inactive, then all is well.
Otherwise, if the memory consumption is slowly increasing, there is still a leak.

The exact Go version used, with patch level:

{{$ }}go version

go1.21.1 darwin/amd64

The exact version of the Go driver used:

$ go list -m go.mongodb.org/mongo-driver

go.mongodb.org/mongo-driver v1.12.1

Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.

We have a cluster at Atlas MongoDB.  In the cluster, we have a database named 'kdev-csc'.  Within the database, there is a collection named 'projects'.  We use SHA256 authentication.

The operating system and version (e.g. Windows 7, OSX 10.8, ...)

The web service runs in a Kubernetes v1.27.3 pod.  The image is based on Linux x64.

Security Vulnerabilities

If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here:

NONE



 Comments   
Comment by Michael Gardner [ 09/Jan/24 ]

Hello,

This issue can be closed. After updating the non-MongoDB dependencies, the memory leak disappeared.

Mike

Comment by PM Bot [ 07/Oct/23 ]

Hi mike.gardner@ingios.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 08:39:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.