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

Huabin commented on THRIFT-2541:
--------------------------------

Hi Jens,

    We can not reclaim write buffer in writeEnd() because at that time the 
write buffer has not been flushed as the following code says. That's why I 
mixed the two kinds of buffer reclaim in readEnd(). It makes sense because 
readEnd() is the end of a request cycle. We can also reclaim the write buffer 
in flush(), so I provide a version that seperates the write buffer reclaim from 
readEnd() and puts it in flush. 
    //
   oprot_->writeMessageEnd();
   oprot_->getTransport()->writeEnd();
   oprot_->getTransport()->flush();
    //
    
    

> reclaim TFramedTransport's read and write buffers for thrift cpp
> ----------------------------------------------------------------
>
>                 Key: THRIFT-2541
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2541
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.9.1
>            Reporter: Huabin
>            Assignee: Jens Geyer
>             Fix For: 0.9.2
>
>         Attachments: THRIFT-2541.patch
>
>
> The internal read and write buffer holds more and more memory but with no 
> chance to reclaim , which causes service that use thrift client pool takes a 
> large amount of memory. A thresh can be set that trades off between malloc 
> and free memory frequently and amount of memory usage.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to