chao.wu created THRIFT-2867:
-------------------------------

             Summary: thrift memory leak with "TThreadPoolServer" 
,"TBufferedTransport", "TCompactProtocol"
                 Key: THRIFT-2867
                 URL: https://issues.apache.org/jira/browse/THRIFT-2867
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Compiler
    Affects Versions: 0.9.1
         Environment: Linux version 2.6.32-431.el6.x86_64
g++ (GCC) 4.7.2 
            Reporter: chao.wu


the memory leaks   4kb per  1000 query.



the server 

  shared_ptr<server_handler> handler(new server_handler(&conf));
  shared_ptr<TProcessor> processor(new StorageProcessor(handler));
  
  shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
  shared_ptr<TTransportFactory> transportFactory(new       
                                                            
TBufferedTransportFactory());
  shared_ptr<TProtocolFactory> protocolFactory(new 
                                                            
TCompactProtocolFactory());
  
  boost::shared_ptr<ThreadManager> threadManager = 
                                   
ThreadManager::newSimpleThreadManager(workers);
  shared_ptr<PosixThreadFactory> threadFactory = 
                          shared_ptr<PosixThreadFactory>(new 
PosixThreadFactory()); 
  threadManager->threadFactory(threadFactory);
  threadManager->start();
  TThreadPoolServer server(processor, serverTransport, transportFactory, 
                                         protocolFactory, threadManager);
  server.setTimeout(servertimeout);
  server.serve();


the handler class has only one function like 

  void getDocFeatures(ResultFeatureList& _return, const 
                                             std::vector<std::string> & doc_ids)
{
    return;
}









--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to