[GODRIVER-1152] Memory leak in connection.ReadWireMessage Created: 19/Jun/19  Updated: 27/Oct/23  Resolved: 24/Jun/19

Status: Closed
Project: Go Driver
Component/s: Networking
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: David Bartley Assignee: Divjot Arora (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I'm trying to switch from mgo to the mongo-go-driver in a relatively simple oplog tailing application. After a few hours, I observe rather high resident memory (multiple GiB). When I take a heap profile, it's implicating connection.ReadWireMessage; specifically "c.readBuf = make([]byte, size)".

This is somewhat similar to GODRIVER-951, but I believe that is caused by a different bug, because in my case, I'm only seeing 16 MiB blocks being allocated, as expected.



 Comments   
Comment by Divjot Arora (Inactive) [ 24/Jun/19 ]

bartle I'm closing this ticket as it seems like the issue was caused externally. Also, the code for ReadWireMessage has changed in master to take a []byte rather than caching a buffer on the connection object itself, so the performance characteristics will change as well.

Comment by David Bartley [ 24/Jun/19 ]

I did a bit more debugging and tracked it down to leaked Client's (i.e. Disconnect was not being called).

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