question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong MongoDB instrumentation configuration leads to memory leaks

See original GitHub issue

Now, brave mongo instrumentation uses thread-local variables to keep stacks of spans, so it can’t be used in an asynchronous environment.

Brave mongo client instrumentation is enabled when mongodb-driver-core is on the classpath, which is also used as a part of the asynchronous mongodb driver mongodb-driver-reactivestreams.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marcingrzejszczakcommented, May 11, 2021

With Mongodb version 4.2 the internals are rewritten to use Reactor. Since we’re already instrumenting project reactor things just work out of the box. We could leverage the builder customizer again regardless of whether it’s reactive or not. WDYT @jonatan-ivanov , @beatfreaker , @ppressives ?

0reactions
marcingrzejszczakcommented, May 11, 2021

Ok I did another analysis and indeed there is improvement in comparison to mongo 4.1.x but the thread local span does not continue the trace from the reactor context. This would need to be improved somehow… cc @mp911de

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suspect that $exists is causing a memory leak - MongoDB
The query takes a very long time and fills all the RAM, and as a result the connection to the MongoDB server breaks....
Read more >
Memory leak with Mongo Java Connection - Stack Overflow
The mongo client is trying to connect to a mongos instance.The application has 3 replica sets on 3 shards and one config server...
Read more >
Spring MongoDB Monitoring - TechDocs
You can view Spring MongoDB backend request metrics, including request details. Spring MongoDB Monitoring is bundled with the Java Agent.
Read more >
Node.js Memory Leak Detection: How to Debug & Avoid Them
Memory leaks often go unnoticed. This is why I suggest using a tool to keep track of historical data of garbage collection cycles...
Read more >
Avoiding Memory Leaks in Node.js: Best Practices for ...
Multiple references : When the same object is referenced from multiple objects, it might lead to a memory leak when one of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found