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

Jun Rao commented on KAFKA-671:
-------------------------------

Thinking about this a bit more. There is another approach. In 
KafkaApis.handle(), after the request is handled, we set 
RequestChannel.Request.requestObj to null. At this point, the response is not 
sent yet. Currently, requestObj is needed when sending a response is in 
RequestChannel.Request.updateRequestMetrics() where we need to print requestObj 
(in trace). What we can do is that in RequestChannel.Request, after requestObj 
is constructed, get and cache the string value of request (set the string to 
null if not trace enabled). We also need to cache isFromFollower which is 
obtained from requestObj. This way, we don't need ProducerRequest.resetData() 
and we can guarantee that after KafkaApis.handle(), each requestObj can be 
GC-ed.
                
> DelayedProduce requests should not hold full producer request data
> ------------------------------------------------------------------
>
>                 Key: KAFKA-671
>                 URL: https://issues.apache.org/jira/browse/KAFKA-671
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.8
>            Reporter: Joel Koshy
>            Assignee: Sriram Subramanian
>            Priority: Blocker
>             Fix For: 0.8.1
>
>         Attachments: outOfMemFix-v1.patch
>
>
> Per summary, this leads to unnecessary memory usage.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to