Closed ilya40umov closed 10 months ago
Hi @ilya40umov, Thank you for your report. We are aware of issues around the lettuce instrumentation. If you do have a small repro app that would be fantastic. Thanks again.
So far I have spent a few hours trying to create a sample project with a limited set of code that would reproduce this problem (same set of libs, same version of Spring Boot, same version of NewRelic agent), but with no avail. Looks like I may be missing some critical piece (e.g. some of our custom configurations we have for Redis or DB layer perhaps). Anyway, I may come back to this topic later in the next few weeks in time permits.
Summary
We recently ran into a memory leak related to NewRelic agent with lettuce instrumentation enabled. Memory leak was very visible by the growing size of the old gen and the number of transaction objects referenced from the NewRelic agent.
Current Workaround
Disabling the lettuce instrumentation fully solved this problem for us:
Steps to Reproduce
The problem only manifested in a code path which was calling a repository method with two consecutive calls to the Lettuce client (done via Spring Data wrapper), and before and after this call there are other suspending operations (e.g. db calls). The repository method was similar to the following code:
Your Environment
Kotlin, Spring Boot 2, WebFlux, Coroutines, R2DBC + Lettuce + AWS CDK (e.g. for S3 and SQS/SNS), NewRelic agent (8.2.0).
P.S.
If this is not something that you folks are aware of, I could try building a sample project with a similar stack that would reproduce it.