spring-cloud/spring-cloud-sleuth

memory leak while using brave library from Spring cloud sleuth

siganapathy opened this issue · 3 comments

Describe the bug
We use spring cloud sleuth library for tracing in our application. We deploy our application on kubernetes. We have observed that long running pods (more than 10 days) experience High CPU usage (around 300-350%). GC threads get stuck spending (90% CPU). When we took heap dump, we observed this class brave.baggage.CorrelationUpdateScope$Single taking up 55% of size. looks like there is a memory leak and it is not getting garbage collected properly. This class belongs to the brave library which comes from the spring-cloud-sleuth-brave library which is a transitive dependency coming from parent spring-cloud-starter-sleuth dependency. Can someone share some insights on this ?

Spring boot version - 2.7.6
JDK - 11
springCloudVersion - 2021.0.5
Dependencies included:
org.springframework.cloud:spring-cloud-starter-sleuth - 3.1.5
-> org.springframework.cloud:spring-cloud-sleuth-brave:3.1.5
-> io.zipkin.brave:brave:5.13.9

brave_error_2

brave_error

Sample
If possible, please provide a test case or a minimal Maven sample written in Java that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.

Can you create a sample that replicates the problem?

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.