Memory leak with spring-kafka 2.8.0
See original GitHub issueUpdating Spring Boot 2.5.7 to 2.6.1 brings spring-kafka 2.8.0, in a service with a massive kafka producer it causes a memory leak.



Rolling back to Spring Boot 2.5.7 fix the issue.
Sample Producer:
@Component
class KafkaProducer(
private val kafkaTemplate: KafkaTemplate<String, MyObject>,
private val kafkaLoggerCallback: KafkaLoggerCallback
) {
@Async
@EventListener
fun process(id, String, event: MyObject) {
kafkaTemplate.send("topic", id, event).addCallback(kafkaLoggerCallback)
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
3.0.1- kafka admin clients created repeatedly - Memory leak ...
We have springboot app that consumes from a single topic and produces records to multiple topics. Recently upgraded this app to Sprinboot-2.6.7 ...
Read more >spring-projects/spring-kafka - Gitter
This is very likely to create a memory leak. Stack trace of thread: This is a non-spring boot app. I am thinking it's...
Read more >Release Notes - Kafka - Version 2.8.0
The upgrade notes discuss any critical information about incompatibilities and breaking changes, performance changes, and any other changes that might impact ...
Read more >What's New in Apache Kafka 2.8 - KIP-500 - Confluent
I'm proud to announce the release of Apache Kafka 2.8.0 on behalf of the ... The 2.8.0 release contains many new features and...
Read more >Debugging a memory leak in Apache Kafka® | by Javier Navarro
We then jumped into analyzing the Heap Memory usage. Turned out the broker that had the issue was getting an increased use of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, you can, but please, link back here when you raise an issue for Apache Kafka project, so we will know what is going on their side. Thanks
According to the last comment, the issue was caused by an incompatible producer interceptor.
https://issues.apache.org/jira/browse/KAFKA-13597?focusedCommentId=17477981&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17477981