[ 
https://issues.apache.org/jira/browse/KAFKA-9609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045685#comment-17045685
 ] 

Satish commented on KAFKA-9609:
-------------------------------

[~sliebau] Thanks for quick reply. You are right it may be correct with respect 
to the use case you mentioned. But for my use case I create many dynamic topics 
and delete them after a while, so I may not be interested in the metrics for 
that topic once it is deleted. So It should be good if we had an option to 
clean the Metrics for that topic alone. Could you please clarify me on the 
following.
 # Is there any way we can clear the Metrics for the deleted topics? 
 # Is it good idea to use 1:1 producer for every dynamic topic and close them 
when the topic is deleted? 

Or Any other suggestions?

 

> Memory Leak in Kafka Producer
> -----------------------------
>
>                 Key: KAFKA-9609
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9609
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, producer 
>    Affects Versions: 2.4.0
>            Reporter: Satish
>            Priority: Major
>
> org.apache.kafka.clients.producer.internals.Sender adds Topic Metrics for 
> every topic that we are writing messages to but it never been cleaned up 
> until we close the producer.
> This is an issue if we use single producer and have more number of Dynamic 
> topics (eg: ~ 500 topics per hour) and writing messages to them.  As this 
> Metrics map is getting accumulated for every topic, over a period of time we 
> notice the memory usage gets increased gradually. 
> It can be easily reproducible by writing messages to the more # of dynamic 
> topics using the same KafkaProducer from apache kafka client libraries or 
> KafkaTemplate from Spring.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to